X-Original-To: pgsql-hackers@postgresql.org Received: from candle.pha.pa.us (momjian.navpoint.com [207.106.42.251]) by postgresql.org (Postfix) with ESMTP id 95447476367; Mon, 10 Mar 2003 11:26:07 -0500 (EST) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.10.1) id h2AGQ0801381; Mon, 10 Mar 2003 11:26:00 -0500 (EST) From: Bruce Momjian Message-Id: <200303101626.h2AGQ0801381@candle.pha.pa.us> Subject: Re: Cursors and backwards scans and SCROLL In-Reply-To: <17531.1047310893@sss.pgh.pa.us> To: Tom Lane Date: Mon, 10 Mar 2003 11:26:00 -0500 (EST) Cc: "Jeroen T. Vermeulen" , pgsql-hackers@postgresql.org, pgsql-sql@postgresql.org X-Mailer: ELM [version 2.4ME+ PL99 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Archive-Number: 200303/353 X-Sequence-Number: 36599 Just a reminder that we could use cursors that exist after transaction commit (WITH HOLD) and updatable cursors (WHERE CURRENT OF cursorname). :-) --------------------------------------------------------------------------- Tom Lane wrote: > "Jeroen T. Vermeulen" writes: > >> There are cases where > >> identical cursor definitions might allow or not allow backwards fetch > >> depending on the planner's choices. > > > Would it be possible to give warnings in a narrow superset of the > > problematic cases, something along the lines of "I'm scrolling backwards > > for you now, but there's no reason why that should work on this same query > > tomorrow"? > > I don't see a practical way to do that --- that little bit of warning > code would have to embed a lot of fragile assumptions about the set of > alternatives searched by the planner. It would probably break every > time we improved the planner. And the breakage would consist either of > failing to give a warning when one is appropriate, or giving a warning > when no other plan is really likely to be chosen; neither of which are > going to be easily noticed or tested for. Seems like a losing game :-( > > regards, tom lane > > ---------------------------(end of broadcast)--------------------------- > TIP 6: Have you searched our list archives? > > http://archives.postgresql.org > -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073