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

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #1947: Enhancement Request - CONCAT() function
Дата
Msg-id 549.1128803590@sss.pgh.pa.us
обсуждение исходный текст
Ответ на BUG #1947: Enhancement Request - CONCAT() function  ("Tony Marston" <tony@marston-home.demon.co.uk>)
Ответы Re: BUG #1947: Enhancement Request - CONCAT() function
Список pgsql-bugs
"Tony Marston" <tony@marston-home.demon.co.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

В списке pgsql-bugs по дате отправления: