Re: attempted to lock invisible tuple - PG 8.4.1

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Stuart Bishop <stuart(at)stuartbishop(dot)net>
Cc: Alban Hertroys <dalroi(at)solfertje(dot)student(dot)utwente(dot)nl>, pgsql-general(at)postgresql(dot)org
Subject: Re: attempted to lock invisible tuple - PG 8.4.1
Date: 2009-10-06 16:46:43
Message-ID: 20091006164643.GM5929@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Alvaro Herrera wrote:

> Here's a slightly smaller test case; basically I removed the tsearch2
> cruft and extra columns in the table. One thing of note is that if the
> COPY commands is reduced to occupy less than one page in the target
> table, the problem does not occur.

And here's an even smaller one that doesn't involve plpython.

create or replace function upd() returns trigger language plpgsql as
$$
declare
rec record;
begin
new.description = 'updated in trigger';
return new;
end;
$$;

create table onetest (
id int,
filler text,
description text
);

create trigger onetest_t before update on onetest for each row
execute procedure upd();

insert into onetest select a, repeat('xyzxz', 100), 'new' from generate_series(1, 50) a;

BEGIN;
SET transaction isolation level SERIALIZABLE;
UPDATE onetest SET description = 'no no', id = 1 where id = 1;
commit;

--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jonathan Vanasco 2009-10-06 16:57:58 is it possible to do an update with a nested select that references the outer update ?
Previous Message Richard Huxton 2009-10-06 16:27:46 Re: Wishlist of PL/Perl Enhancements for PostgreSQL 8.5