Re: Why isn't DECLARE CURSOR ... FOR UPDATE supported? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Why isn't DECLARE CURSOR ... FOR UPDATE supported?
Date
Msg-id 20427.1071766585@sss.pgh.pa.us
Whole thread Raw
In response to Re: Why isn't DECLARE CURSOR ... FOR UPDATE supported?  (Rod Taylor <pg@rbt.ca>)
Responses Re: Why isn't DECLARE CURSOR ... FOR UPDATE supported?  (Gavin Sherry <swm@linuxworld.com.au>)
Re: Why isn't DECLARE CURSOR ... FOR UPDATE supported?  (Shachar Shemesh <psql@shemesh.biz>)
List pgsql-hackers
Rod Taylor <pg@rbt.ca> writes:
> On Thu, 2003-12-18 at 10:20, Tom Lane wrote:
>> Is there any good reason for this restriction?

> The help implies you can.

> DECLARE name [ BINARY ] [ INSENSITIVE ] [ [ NO ] SCROLL ]
>     CURSOR [ { WITH | WITHOUT } HOLD ] FOR query
>     [ FOR { READ ONLY | UPDATE [ OF column [, ...] ] } ]

Hmm.  Actually that is describing the SQL spec's syntax for DECLARE
CURSOR, in which you can name specific *columns* not tables as being
updatable through the cursor.  Now that I think about it, the error
check is probably there to catch anyone who writes "FOR UPDATE OF
column" expecting to get the SQL spec behavior.

I'm not sure whether anyone is planning to try to converge our notion of
FOR UPDATE with the spec's.  If that is going to happen someday, it'd
probably be best not to introduce directly conflicting behavior into
DECLARE CURSOR.  Oh well...
        regards, tom lane


pgsql-hackers by date:

Previous
From: Dave Cramer
Date:
Subject: Re: ecpg tests compile failure
Next
From: Andrew Dunstan
Date:
Subject: replace all with * in pg_hba.conf