Re: writing a function without installing a language

Поиск
Список
Период
Сортировка
От Leif B. Kristensen
Тема Re: writing a function without installing a language
Дата
Msg-id 200805171123.09641.leif@solumslekt.org
обсуждение исходный текст
Ответ на writing a function without installing a language  ("${spencer}" <spence91@gmail.com>)
Список pgsql-general
On Friday 16. May 2008, ${spencer} wrote:
>is there a way to write a function without installing a specific
>language? all i need to do is write a function that can take 3 text's
>and put them into a list format (eg. "text1, text2 and text3" )
>
>can anyone help?

sandbox=> create function foo(text,text,text) returns text as $$
sandbox$> select $1 || ', ' || $2 || ', and ' || $3
sandbox$> $$ language sql stable;
CREATE FUNCTION
sandbox=> select foo('x','y','z');
     foo
-------------
 x, y, and z
(1 row)

sandbox=>
--
Leif Biberg Kristensen | Registered Linux User #338009
http://solumslekt.org/ | Cruising with Gentoo/KDE
My Jazz Jukebox: http://www.last.fm/user/leifbk/

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

Предыдущее
От: Craig Ringer
Дата:
Сообщение: Re: how to return parts of records from a function
Следующее
От: iSteve
Дата:
Сообщение: tsearch2 on-demand dictionary loading & using functions in tsearch2