Re: Locks on temp table and PREPARE - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: Locks on temp table and PREPARE
Date
Msg-id 20090603210131.GT7172@alvh.no-ip.org
Whole thread Raw
In response to Re: Locks on temp table and PREPARE  (Emmanuel Cecchet <manu@frogthinker.org>)
List pgsql-hackers
Emmanuel Cecchet wrote:
> Tom Lane wrote:
>> True, but the problem is that the tuple might still be live to (some
>> snapshots in) that transaction, so we can't inject a duplicate tuple
>> without risking confusing it.  In this particular case that isn't an
>> issue because the transaction is done executing, but the tqual.c
>> rules don't know that.
>>   
> Please excuse my ignorance. I am not sure to get how the tuple could  
> still be live to some snapshots after the transaction has prepared. What  
> could still happen to objects that were only visible to a transaction  
> after it has prepared? An example would definitely help.

The classic example is having an open cursor that references the table.
(In this case it doesn't work, but the snapshot management module and
tqual.c don't know it.)  If you want this to work you need to improve
those modules, and who knows what else ...

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


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Locks on temp table and PREPARE
Next
From: Pavel Stehule
Date:
Subject: Re: Postgres delays function returning large set of data