Re: writing a function without installing a language

From: "Leif B(dot) Kristensen" <leif(at)solumslekt(dot)org>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: writing a function without installing a language
Date: 2008-05-17 09:23:09
Message-ID: 200805171123.09641.leif@solumslekt.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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/

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Craig Ringer 2008-05-17 09:31:24 Re: how to return parts of records from a function
Previous Message Craig Ringer 2008-05-17 09:22:25 Re: migration problem