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 20091006172136.GN5929@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
List pgsql-general
I think the previous patch to snapmgr.c was mistaken.  Instead of fixing
a single trouble spot, we're better off fixing PushActiveSnapshot so
that any use of it that involves a snapshot that's subject to a future
command counter update should create a new copy.

This is correct because the 8.3 code used to do CopySnapshot anytime it
was setting ActiveSnapshot.  So we're not disrupting any behavior here
-- we're merely restoring what was the previous customary behavior.

The attached patch implements this idea.  It reverts the code changes
done in the previous patch, because they're obviously no longer
necessary.  The new regression test that it added still passes with this
new patch.  I will add a new one for this new problem.

(This new patch restores CopySnapshot as a static function too).

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

Attachment

pgsql-general by date:

Previous
From: Jonathan Vanasco
Date:
Subject: is it possible to do an update with a nested select that references the outer update ?
Next
From: Alvaro Herrera
Date:
Subject: Re: attempted to lock invisible tuple - PG 8.4.1