Re: attempted to lock invisible tuple - PG 8.4.1 - Mailing list pgsql-general

From Alvaro Herrera
Subject Re: attempted to lock invisible tuple - PG 8.4.1
Date
Msg-id 20091006164643.GM5929@alvh.no-ip.org
Whole thread Raw
In response to Re: attempted to lock invisible tuple - PG 8.4.1  (Alvaro Herrera <alvherre@commandprompt.com>)
Responses Re: attempted to lock invisible tuple - PG 8.4.1
Re: attempted to lock invisible tuple - PG 8.4.1
List 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

pgsql-general by date:

Previous
From: Richard Huxton
Date:
Subject: Re: Wishlist of PL/Perl Enhancements for PostgreSQL 8.5
Next
From: Jonathan Vanasco
Date:
Subject: is it possible to do an update with a nested select that references the outer update ?