SETOF modifier - Mailing list pgsql-novice

From Jason Davis
Subject SETOF modifier
Date
Msg-id 200010160404.PAA19463@zeus.tassie.net.au
Whole thread Raw
Responses Re: SETOF modifier  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-novice
Hi all

I have been trying to create a basic SQL function which returns a SETOF
values, without much luck. The docs make plenty of mention of the fact you
can return multiple values from a function, but unfortunately don't give
any examples as such. The syntax I thought would work is along the lines of

CREATE FUNCTION sp_testing() RETURNS setof text AS '
        SELECT col1, col2, col3 FROM table;
' LANGUAGE 'sql';

I'd much appreciate anyone's help who has encountered this one before or
who knows the syntax!

regards
Jason Davis
DB Administrator/Programmer
www.tassie.net.au


pgsql-novice by date:

Previous
From: Webb Sprague
Date:
Subject: Syslog and Postgres
Next
From: Tom Lane
Date:
Subject: Re: SETOF modifier