Re: Wishlist? - Mailing list pgsql-general

From Ezequiel Tolnay
Subject Re: Wishlist?
Date
Msg-id dc1gul$1144$1@news.hub.org
Whole thread Raw
In response to Re: Wishlist?  ("Jim C. Nasby" <decibel@decibel.org>)
List pgsql-general
Jim C. Nasby wrote:
> On Thu, Jul 21, 2005 at 07:10:03PM +1000, Ezequiel Tolnay wrote:
>>* Allow FETCH command to be used with CREATE TABLE tab AS qry (in place
>>of qry)
>
> I'm not really clear on what you're looking for here..

Fetching from a cursor should be equivalent to selecting from a table,
and a function could benefit from being able to run CREATE TABLE ... AS
using the results of a cursor.

Basically I've been trying to automate the handing of query results from
a web-front end, which cannot rely on temporary tables since the
sessions are short lived, but the results need to be retrieved in a
paged fashion. A great solution to this would be to have functions
opening a dynamic cursor and passing this cursor to another function
that would to the creation/maintenance of these transient tables, but
unfortunately there is no way of using a cursor from a function that
doesn't handle specifically its record type.

For this purpose (and perhaps many others) if figure it would be greate
if PG would support the command " CREATE TABLE tab AS FETCH ALL FROM cur
". It would be even better if in plpgsql you would be able to use a
cursor variable instead of an EXECUTE 'CREATE TABLE tab AS FETCH ALL
FROM "' || v_cur || '"'.

Cheers,

Ezequiel Tolnay

pgsql-general by date:

Previous
From: Ezequiel Tolnay
Date:
Subject: Re: Wishlist?
Next
From: Ezequiel Tolnay
Date:
Subject: Re: Wishlist?