Skip site navigation (1) Skip section navigation (2)

Re: Bug in concat operator for Char? -- More Info

From: Darcy Buskermolen <darcy(at)wavefire(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>,pgsql-bugs(at)postgresql(dot)org, glenniii(at)mail(dot)utexas(dot)edu
Subject: Re: Bug in concat operator for Char? -- More Info
Date: 2004-07-21 19:06:09
Message-ID: 200407211206.09696.darcy@wavefire.com (view raw or flat)
Thread:
Lists: 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

In response to

pgsql-bugs by date

Next:From: PostgreSQL Bugs ListDate: 2004-07-21 22:24:04
Subject: BUG #1199: pgAdmin problem
Previous:From: Andreas PflugDate: 2004-07-21 16:13:32
Subject: Re: Bug in concat operator for Char? -- More Info

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group