On Thu, 15 Jan 2004, Bill Moran wrote:
> I'm having a little trouble understanding how to do something. I assume
> I'm just missing it in the documentation, so a pointer to relevent docs
> would be as welcome as a direct answer.
>
> I have a project in which I'll need to create a number of stored
> procedures that are basically wrappers around complex SQL statements.
> Along the lines of:
>
> CREATE OR REPLACE FUNCTION expired(anyelement)
> RETURNS SETOF anyelement AS '
You probably don't want SETOF anyelement here. I would read that as a set
of any one thing at best. You probably want to be defining a composite
type with create type and return SETOF thattype or returning SETOF record
and defining the type on the select that uses the function.
You can find more information at
http://techdocs.postgresql.org/guides/SetReturningFunctions
or in General Bits (the url to which I cannot remember off hand).