Re: BUG #1947: Enhancement Request - CONCAT() function

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Tony Marston" <tony(at)marston-home(dot)demon(dot)co(dot)uk>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #1947: Enhancement Request - CONCAT() function
Date: 2005-10-08 20:33:10
Message-ID: 549.1128803590@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

"Tony Marston" <tony(at)marston-home(dot)demon(dot)co(dot)uk> writes:
> I would like the option to use CONCAT(field1, ' ', field2) instead of the
> vertical bar syntax (field1 || ' ' || field2) as this is also available in
> other popular databases (MySQL, ORACLE).

|| is the SQL standard, CONCAT() is not. But feel free to write your
own functions:

create function concat(text,text) returns text as
'select $1 || $2' language sql strict immutable;
create function concat(text,text,text) returns text as
'select $1 || $2 || $3' language sql strict immutable;
... repeat up to whatever number of parameters seems needed ...

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2005-10-08 20:48:56 Re: BUG #1937: Parts of information_schema only accessible to owner
Previous Message Jim C. Nasby 2005-10-08 19:52:18 Re: BUG #1948: Enhancement Request - INSERT syntax