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

From Emmanuel Cecchet
Subject Re: Locks on temp table and PREPARE
Date
Msg-id 4A26EB3A.7070400@frogthinker.org
Whole thread Raw
In response to Re: Locks on temp table and PREPARE  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Locks on temp table and PREPARE
List pgsql-hackers
Tom Lane wrote:
> Emmanuel Cecchet <manu@frogthinker.org> writes:
>   
>> 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.
>>     
>
> Well, it couldn't be because there are no snapshots in that transaction
> anymore.  The problem is that the *other* transaction doesn't have a
> good way to know that.  It just sees an open transaction with
> conflicting unique-index changes.
>   
But when the transaction prepares, we know that. What would prevent us 
to do at prepare time the same cleanup that commit does?
                        regards, manu (indentation (C) tom lane)


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Plan time Improvement - 64bit bitmapset
Next
From: Tom Lane
Date:
Subject: Re: Locks on temp table and PREPARE