Re: Returning large select results from stored procedures

From: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>
To: Bill Moran <wmoran(at)potentialtech(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Returning large select results from stored procedures
Date: 2004-01-15 15:56:28
Message-ID: 20040115075034.Q36122@megazone.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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).

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Victor Spång Arthursson 2004-01-15 15:56:48 Foreign key question
Previous Message Tom Lane 2004-01-15 15:54:55 Re: fixed-length row