Bug in concat operator for Char? - Mailing list pgsql-bugs

From Josh Berkus
Subject Bug in concat operator for Char?
Date
Msg-id 200407201100.53238.josh@agliodbs.com
Whole thread Raw
Responses Re: Bug in concat operator for Char? -- More Info  (Josh Berkus <josh@agliodbs.com>)
List pgsql-bugs
People,

Severity:  Serious Annoyance
Reproducable on:  7.4.1, 7.4.3, 7.5devel
Summary:  Concatination of CHAR() data type field seems to result in a TEXT
value instead of a CHAR value.   Is there a reason for this?

Example:
webmergers=> select '"'::char(4) || ''::char(4) || '"'::char(4);
 ?column?
----------
 ""
(1 row)

Depending on the spec, it seems to me that the above should result either in a
char(4) of "  " or a char(12) of "       "   .   But we get a text value.
Is this the SQL spec?   Is there another reason for this behavior?

--
-Josh Berkus
 Aglio Database Solutions
 San Francisco

pgsql-bugs by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: BUG #1198: Linux PostgreSQL Server Input Validation Vulnerability
Next
From: Josh Berkus
Date:
Subject: Re: Bug in concat operator for Char? -- More Info