"ORDER BY" clause prevents "UPDATE WHERE CURRENT OF" - Mailing list pgsql-hackers

From Robert Haas
Subject "ORDER BY" clause prevents "UPDATE WHERE CURRENT OF"
Date
Msg-id 603c8f070811141332l3b8ebbc0vaf70219a27cc795@mail.gmail.com
Whole thread Raw
Responses Re: "ORDER BY" clause prevents "UPDATE WHERE CURRENT OF"
Re: "ORDER BY" clause prevents "UPDATE WHERE CURRENT OF"
List pgsql-hackers
I found the following behavior surprising.  Is there a reason for it?
This is 8.3.5.   ...Robert

rhaas=# BEGIN WORK;
BEGIN
rhaas=# CREATE TABLE test_table (id serial, foo integer, bar integer);
NOTICE:  CREATE TABLE will create implicit sequence
"test_table_id_seq" for serial column "test_table.id"
CREATE TABLE
rhaas=# INSERT INTO test_table VALUES (DEFAULT, 1, 1);
INSERT 0 1
rhaas=# DECLARE c CURSOR FOR SELECT id FROM test_table ORDER BY foo FOR UPDATE;
DECLARE CURSOR
rhaas=# FETCH c;id
---- 1
(1 row)

rhaas=# UPDATE test_table SET bar = NULL WHERE CURRENT OF c;
ERROR:  cursor "c" is not a simply updatable scan of table "test_table"
rhaas=# \q


pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: Signal handling patch (v2) for Synch Rep
Next
From: Alvaro Herrera
Date:
Subject: Re: WIP: Column-level Privileges