Re: Bug in concat operator for Char? -- More Info - Mailing list pgsql-bugs

From Darcy Buskermolen
Subject Re: Bug in concat operator for Char? -- More Info
Date
Msg-id 200407211206.09696.darcy@wavefire.com
Whole thread Raw
In response to Re: Bug in concat operator for Char? -- More Info  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
On July 21, 2004 08:22 am, Tom Lane wrote:
>
> IMHO the bottom line here is that the SQL-spec behavior of type char(N)
> is completely brain-dead.  Practically all of the questions in this area
> would go away if people used varchar(N) or text to store their data.
>
>             regards, tom lane
For reference sake oracle treats it as follows:

<Dorm> SQL> create table dummy (value char(4));
<Dorm> Table created.
<Dorm> SQL> insert into dummy values ('A');
<Dorm> 1 row created.
<Dorm> SQL> commit;
<Dorm> Commit complete.
<Dorm> SQL> select value||value from dummy;
<Dorm> VALUE||V
<Dorm> --------
<Dorm> A   A
<Dorm> SQL> select length(value||value) from dummy;
<Dorm> LENGTH(VALUE||VALUE)
<Dorm> --------------------
<Dorm>                    8



--
Darcy Buskermolen
Wavefire Technologies Corp.
ph: 250.717.0200
fx:  250.763.1759
http://www.wavefire.com

pgsql-bugs by date:

Previous
From: Andreas Pflug
Date:
Subject: Re: Bug in concat operator for Char? -- More Info
Next
From: "PostgreSQL Bugs List"
Date:
Subject: BUG #1199: pgAdmin problem