From: | Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> |
---|---|
To: | Karel Zak - Zakkr <zakkr(at)zf(dot)jcu(dot)cz> |
Cc: | pgsql-hackers <pgsql-hackers(at)postgreSQL(dot)org> |
Subject: | Re: [HACKERS] empty concatenate |
Date: | 1999-12-23 15:56:20 |
Message-ID: | 199912231556.KAA05091@candle.pha.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
>
> Hi,
>
> I try concatenate text via standard '||' oprerator, but result is
> interesting:
>
> PgSQL 6.5.3/7.0:
> ~~~~~~~~~~~~~~~
> test=> select * from x;
> a |b
> ---+---
> AAA|BBB
> xxx|
> (2 rows)
>
> test=> select a || b from x;
> ?column?
> --------
> AAABBB
> <-------------- empty !
> (2 rows)
NULL's can not be concatenated, but '' can. Looks fine to me:
---------------------------------------------------------------------------
test=> create table ff (x text, y text);
insCREATE
test=> insert into ff values ('a','');
INSERT 19082 1
test=> insert into ff values ('b',null);
INSERT 19083 1
test=> select x || y from ff;
?column?
----------
a
(2 rows)
--
Bruce Momjian | http://www.op.net/~candle
maillist(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026
From | Date | Subject | |
---|---|---|---|
Next Message | Lamar Owen | 1999-12-23 15:59:50 | --with-mb=SQL_ASCII for 6.5.3 RPMs. |
Previous Message | Karel Zak - Zakkr | 1999-12-23 15:55:55 | Re: [HACKERS] empty concatenate |