From: Skylar Hawk <skylar.j.hawk@gmail.com>
To: pgsql-bugs@postgresql.org
Subject: BUG #6020: Wrong data type returned after CAST in FROM
Date: Tue, 10 May 2011 22:36:32 GMT
Message-ID: <201105102236.p4AMaW5e038211@wwwmaster.postgresql.org> (raw)
The following bug has been logged online:
Bug reference: 6020
Logged by: Skylar Hawk
Email address: skylar.j.hawk@gmail.com
PostgreSQL version: 9.0.3
Operating system: OpenBSD
Description: Wrong data type returned after CAST in FROM
Details:
Hello,
I noticed a strange nuance. When I do a regular select on data that I CAST
as a CHAR(), the data I am returned is of type character() as I would
expect. For example:
SELECT
CAST('abcd' AS CHAR(4)) AS data
This returns 'abcd' where the type is character(4).
However, if I do the cast in the FROM portion of the query such as this:
SELECT
data
FROM
CAST('abcd' AS CHAR(4)) AS data
then I am returned 'abcd' and the type is bpchar.
I did not have this issue when I was using Postgres 8.4. I upgraded last
week, and that's when I noticed the issue in a couple database functions I
had written.
-Sky
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: skylar.j.hawk@gmail.com
Subject: Re: BUG #6020: Wrong data type returned after CAST in FROM
In-Reply-To: <201105102236.p4AMaW5e038211@wwwmaster.postgresql.org>
References: <201105102236.p4AMaW5e038211@wwwmaster.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox