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
Views: Raw Message | Whole Thread | Download mbox | Resend email
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

Browse pgsql-bugs by date

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