Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search archives
  Advanced Search

Re: Weird behavior with "sensitive" cursors.


  • From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
  • To: Daniel F <dbf13db(at)gmail(dot)com>
  • Cc: pgsql-general(at)postgresql(dot)org
  • Subject: Re: Weird behavior with "sensitive" cursors.
  • Date: Wed, 30 Sep 2009 14:09:10 -0400
  • Message-id: <20090930180910.GH8280@alvh.no-ip.org> <text/plain>

Daniel F escribió:

> SET SESSION CHARACTERISTICS AS TRANSACTION ISOLATION LEVEL SERIALIZABLE;
> begin;
> show transaction isolation level;
> create table foo (a bigint);
> insert into foo select generate_series(0, 9);
> declare c1 no scroll cursor for select * from foo for update;
> update foo set a=1000 where a>5;
> fetch all from c1;

Interesting.  If I create an non-unique index on the table before
declaring the cursor, FETCH throws an error:

alvherre=# fetch all from c1;
ERROR:  attempted to lock invisible tuple

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.



Home | Main Index | Thread Index

Privacy Policy | About PostgreSQL
Copyright © 1996 – 2012 PostgreSQL Global Development Group