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

Re: [HACKERS] empty concatenate

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 (view raw or flat)
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

In response to

Responses

pgsql-hackers by date

Next:From: Lamar OwenDate: 1999-12-23 15:59:50
Subject: --with-mb=SQL_ASCII for 6.5.3 RPMs.
Previous:From: Karel Zak - ZakkrDate: 1999-12-23 15:55:55
Subject: Re: [HACKERS] empty concatenate

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