Re: cursors: SCROLL default, error messages - Mailing list pgsql-hackers

From Greg Stark
Subject Re: cursors: SCROLL default, error messages
Date
Msg-id 87u1dw74j2.fsf@stark.dyndns.tv
Whole thread Raw
In response to Re: cursors: SCROLL default, error messages  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: cursors: SCROLL default, error messages
List pgsql-hackers
Tom Lane <tgl@sss.pgh.pa.us> writes:

> Neil Conway <neilc@samurai.com> writes:
> > On Fri, 2003-03-21 at 12:12, Tom Lane wrote:
> >> (No problem here with adding the noise-word option, of course.)
> 
> > Note that it won't be a noise word: if NO SCROLL is specified, an
> > attempt to do a backward fetch on a non-scrollable cursor will yield an
> > error.

Does the spec *require* an error, or merely say that backward fetches aren't
required to work? 

Most specs don't impose many restrictions on what happens if the user does non
conformant things. The SQL spec is a bit, er, nonstandard in that respect, but
even for it I'm a bit surprised that it would explicitly say that if NO SCROLL
is specified that backward fetches have to produce an error.

The only possible rationale I could see for the spec imposing that kind of
restriction would be a security concern if an middleware layer allocates a NO
SCROLL cursor, pages forward, and then allows an upper tier to do unrestricted
operations on that cursor trusting the database not to allow scrolling back.

--
greg



pgsql-hackers by date:

Previous
From: Barry Lind
Date:
Subject: Re: A bad behavior under autocommit off mode
Next
From: Bruce Momjian
Date:
Subject: Re: A bad behavior under autocommit off mode