Re: Returning large select results from stored procedures - Mailing list pgsql-general

From Stephan Szabo
Subject Re: Returning large select results from stored procedures
Date
Msg-id 20040115075034.Q36122@megazone.bigpanda.com
Whole thread Raw
In response to Returning large select results from stored procedures  (Bill Moran <wmoran@potentialtech.com>)
List pgsql-general
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).


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: fixed-length row
Next
From: Victor Spång Arthursson
Date:
Subject: Foreign key question