Re: Using Cursor in PostgreSQL 7.2

From: Holger Krug <hkrug(at)rationalizer(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Using Cursor in PostgreSQL 7.2
Date: 2001-12-07 19:06:11
Message-ID: 20011207200611.B1462@dev12.rationalizer.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers pgsql-patches

On Fri, Dec 07, 2001 at 12:38:03PM -0500, Tom Lane wrote:
> C functions returning sets are entirely possible, and there's even some
> documentation about how to do it in src/backend/utils/fmgr/README (which
> needs to be transposed to present tense and moved into the SGML docs,
> but it's better than nothing).

Thank you ! I very appreciate your answer.

So what I have to do to let a PL/PGSQL function to return a set to the
client is:

1) let the PL/PGSQL return a cursor
2) write a general C wrapper function cursor_to_set(cursor) which gets a
cursor and returns the result set

My additional questions:

* Is 2) possible if the nature of the cursor is not known in advance ?
* Is the implementation of cursor_to_set very complicated or can it done
with the documentation cited in your mail ?

I think such a function cursor_to_set, if possible, would be very
useful, wouldn't it ?

> There is not presently any support for this sort of thing in plpgsql
> or any of the other PL languages, however.

Having `cursor_to_set' it would be half as bad !

--
Holger Krug
hkrug(at)rationalizer(dot)com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jan Wieck 2001-12-07 19:37:24 Re: When do I Vacuum ?
Previous Message Steve Wolfe 2001-12-07 18:57:49 Re: Errors: Too many open files

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruno Wolff III 2001-12-07 20:09:19 Re: OIDs missing in pg_attribute?
Previous Message Joe Conway 2001-12-07 18:45:23 Re: Using Cursor in PostgreSQL 7.2

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2001-12-07 21:38:48 Re: Using Cursor in PostgreSQL 7.2
Previous Message Joe Conway 2001-12-07 18:45:23 Re: Using Cursor in PostgreSQL 7.2