X-Original-To: pgsql-hackers@postgresql.org Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id 52FE347610C; Mon, 10 Mar 2003 10:41:29 -0500 (EST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.8/8.12.8) with ESMTP id h2AFfXub017532; Mon, 10 Mar 2003 10:41:33 -0500 (EST) To: "Jeroen T. Vermeulen" Cc: pgsql-hackers@postgresql.org, pgsql-sql@postgresql.org Subject: Re: Cursors and backwards scans and SCROLL In-reply-to: <20030310153245.GW98248@xs4all.nl> References: <21621.1047242111@sss.pgh.pa.us> <20030310153245.GW98248@xs4all.nl> Comments: In-reply-to "Jeroen T. Vermeulen" message dated "Mon, 10 Mar 2003 16:32:46 +0100" Date: Mon, 10 Mar 2003 10:41:33 -0500 Message-ID: <17531.1047310893@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200303/344 X-Sequence-Number: 36590 "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