Re: writing a function without installing a language - Mailing list pgsql-general

From Leif B. Kristensen
Subject Re: writing a function without installing a language
Date
Msg-id 200805171123.09641.leif@solumslekt.org
Whole thread Raw
In response to writing a function without installing a language  ("${spencer}" <spence91@gmail.com>)
List 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 by date:

Previous
From: Craig Ringer
Date:
Subject: Re: how to return parts of records from a function
Next
From: iSteve
Date:
Subject: tsearch2 on-demand dictionary loading & using functions in tsearch2