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: 2009-09-30 18:09:10
Message-ID: 20090930180910.GH8280@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message György Vilmos 2009-09-30 18:11:17 Re: Performance evaluation of PostgreSQL's historic releases
Previous Message Bill Moran 2009-09-30 17:45:52 Re: I can not drop a user/role because an object depent on it.