Re: BUG #6020: Wrong data type returned after CAST in FROM - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #6020: Wrong data type returned after CAST in FROM
Date
Msg-id 1750.1305135610@sss.pgh.pa.us
Whole thread Raw
In response to BUG #6020: Wrong data type returned after CAST in FROM  ("Skylar Hawk" <skylar.j.hawk@gmail.com>)
List pgsql-bugs
Skylar Hawk <skylar.j.hawk@gmail.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

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #6020: Wrong data type returned after CAST in FROM
Next
From: Tom Lane
Date:
Subject: Re: BUG #6020: Wrong data type returned after CAST in FROM