Skip site navigation (1) Skip section navigation (2)

Re: [PATCH] [LARGE] select * from cursor foo

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Alex Pilosov <alex(at)pilosoft(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PATCH] [LARGE] select * from cursor foo
Date: 2001-09-04 05:00:49
Message-ID: 200109040500.f8450nP21340@candle.pha.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackers
Your patch has been added to the PostgreSQL unapplied patches list at:

	http://candle.pha.pa.us/cgi-bin/pgpatches

I will try to apply it within the next 48 hours.

> Attached patch does the above.
> 
> Notes:
> 1. Incompatible changes: CURSOR is now a keyword and may not be used as an
> identifier (tablename, etc). Otherwise, we get shift-reduce conflicts in
> grammar.
> 
> 2. Major changes: 
> 
> a) RangeTblEntry (RTE for short) instead of having two possibilities,
> subquery and non-subquery, now has a rtetype field which can be of 3
> possible states: RTE_RELATION, RTE_SUBSELECT, RTE_PORTAL). The
> type-specific structures are unionized, so where you used to have
> rte->relid, now you must do rte->u.rel.relid.
> 
> Proper way to check what is the RTE type is now checking for rte->rtetype
> instead of checking whether rte->subquery is null.
> 
> b) Similarly, RelOptInfo now has a RelOptInfoType which is an enum with 4
> states, REL_PLAIN,REL_SUBQUERY,REL_JOIN,REL_PORTAL. I did not do the
> unionization of type-specific structures. Maybe I should've if I'm going
> to get in a big change anyway.
> 
> c) There's a function PortalRun which fetches N records from portal and
> sets atEnd/atStart values properly. It replaces code duplicated in 2
> places. 
> 
> 
> How to test: 
> 
> declare foo cursor for select * from pg_class;
> 
> select * from cursor foo;
> 
> Documentation updates will be forthcoming ASAP, I just wanted to get this
> patch in queue before the freeze. Or at least making sure someone could
> look through this patch before freeze. :)
> 
> Next patch will be one to support "SELECT * FROM func(arg1,arg2)" which
> would work by creating first a special kind of portal for selection from a
> function and then setting query source to be that portal.
> 
> -alex

Content-Description: 

[ Attachment, skipping... ]

> 
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
> 
> http://www.postgresql.org/users-lounge/docs/faq.html

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman(at)candle(dot)pha(dot)pa(dot)us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

In response to

pgsql-hackers by date

Next:From: Joe ConwayDate: 2001-09-04 05:14:38
Subject: Fw: Random strings
Previous:From: Joe ConwayDate: 2001-09-04 04:55:23
Subject: Re: Bytea/Base64 encoders for libpq - interested?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group