Search Postgresql Archives

Re: writing a function without installing a language

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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/


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux