order by in cursor declaration does not allow update - Mailing list pgsql-hackers

From Dharmendra Goyal
Subject order by in cursor declaration does not allow update
Date
Msg-id f87e6d710710242358mb97b12bu45c70d35681b6500@mail.gmail.com
Whole thread Raw
Responses Re: order by in cursor declaration does not allow update
Re: order by in cursor declaration does not allow update
List pgsql-hackers
If a cursor is declared using "Order by" then it gives following error <br /> during updation of the cursor: <br />
ERROR: cursor "c" is not a simply updatable scan of table "test" <br /> Ex: <br /> DROP TABLE IF EXISTS test;<br />
createtable test (num int,num2 int );<br /> insert into test values(1,100);<br /> insert into test values(2,200);<br />
insertinto test values(3,300);<br /> insert into test values(4,400);<br /> insert into test values(5,500);<br /> BEGIN;
<br/> DECLARE c CURSOR FOR SELECT * FROM test ORDER BY num; <br /> FETCH 2 FROM c; <br /> UPDATE test SET num = 500
WHERECURRENT OF c; <br /> ERROR:  cursor "c" is not a simply updatable scan of table "test" <br /> SELECT * FROM test;
<br/> FETCH 2 FROM c; <br /> COMMIT; <br /> SELECT * FROM test; <br /> FETCH 2 FROM c; <br /> COMMIT;<br /><br />
Commentsfor this...??<br /><br /> Regards,<br /> Dharmendra<br /><a
href="http://www.enterprisedb.com">www.enterprisedb.com</a><br/> 

pgsql-hackers by date:

Previous
From: kris.shannon@gmail.com
Date:
Subject: Re: Feature Freeze date for 8.4
Next
From: "Richard Wang"
Date:
Subject: Re: postgres under linux can't start because of postmaster.pid