Re: BUG #6020: Wrong data type returned after CAST in FROM

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Skylar Hawk <skylar(dot)j(dot)hawk(at)gmail(dot)com>
Cc: pgsql-bugs(at)postgreSQL(dot)org
Subject: Re: BUG #6020: Wrong data type returned after CAST in FROM
Date: 2011-05-11 17:40:10
Message-ID: 1750.1305135610@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Skylar Hawk <skylar(dot)j(dot)hawk(at)gmail(dot)com> writes:
> I got the similar results when I ran similar queries from a ruby
> script using the 'postgres' gem as well, which notified me of the
> difference through the error message. That's actually what alerted me
> to it first. The script calls a plpsql function which expects a
> CHAR(8) and the script died. The database message said the function
> was expecting a CHAR(8) but got a BPCHAR instead.

OK, now I'm really unsure what you're talking about. There's no such
thing as a plpgsql function that "expects a char(8)" --- well, you can
declare it that way, but the database just ignores the length modifier.
And BPCHAR is just the internal name for CHAR(n), so it should certainly
have matched.

Could we see the *exact* function declaration, the exact SQL you issued,
and the exact error message, rather than ambiguous descriptions?

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2011-05-11 18:27:41 Re: BUG #6020: Wrong data type returned after CAST in FROM
Previous Message Tom Lane 2011-05-11 17:04:59 Re: BUG #6020: Wrong data type returned after CAST in FROM