Re: Returning a CURSOR from plpgsql functions

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Darren Ferguson <darren(at)crystalballinc(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: Returning a CURSOR from plpgsql functions
Date: 2002-01-31 19:59:39
Message-ID: 20020131115414.B16538-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, 31 Jan 2002, Darren Ferguson wrote:

> I believe that you can return CURSORS from plpgsql functions however i
> have not been able to figure out exactly how.
>
> Anybody have any ideas ???

create table aa(a int, b int, c int);
create function f() returns refcursor as '
declare
r refcursor;
begin
open r for select * from aa;
return r;
end;' language 'plpgsql';

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Gregory Wood 2002-01-31 20:00:07 Re: going crazy with serial type
Previous Message Bjoern Metzdorf 2002-01-31 19:57:28 Re: process exited with status 11 after XLogFlush: request is not satisfied