Re: SETOF (was: Function example returning more then 1 - Mailing list pgsql-general

From Stephan Szabo
Subject Re: SETOF (was: Function example returning more then 1
Date
Msg-id 20030227082228.P86039-100000@megazone23.bigpanda.com
Whole thread Raw
In response to Re: SETOF (was: Function example returning more then 1  (Kolus Maximiliano <Kolus.maximiliano@bcr.com.ar>)
List pgsql-general
On Thu, 27 Feb 2003, Kolus Maximiliano wrote:

> >     You can't return more than one return value from function, but that
> > value can be of composite type.For example :"setof text" or "setof record"
> > are such types.
>
>     Can you use functions returning "setof"s as if they were "normal"
> selects?.
>
>     I saw that setof takes a type or table as an argument. What if what
> i want to return is not in a table schema, can i do something like "setof
> (blah inet, blah2 varchar(256))"?

You might want to read the Set Returning Functions document on techdocs:
http://techdocs.postgresql.org/guides/SetReturningFunctions

The best answer is to define a row type for it with CREATE TYPE, but you
can also return setof record and rely on the user putting the type
information in the select.


pgsql-general by date:

Previous
From: "scott.marlowe"
Date:
Subject: Re: 7.4?
Next
From: "scott.marlowe"
Date:
Subject: Re: index usage (and foreign keys/triggers)