| From: | Ezequiel Tolnay <mail(at)etolnay(dot)com(dot)ar> |
|---|---|
| To: | pgsql-general(at)postgresql(dot)org |
| Subject: | Re: Wishlist? |
| Date: | 2005-07-25 02:00:14 |
| Message-ID: | dc1gul$1144$1@news.hub.org |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | 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
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Sutha | 2005-07-25 07:51:36 | |
| Previous Message | Ezequiel Tolnay | 2005-07-25 01:44:04 | Re: Wishlist? |