Re: INSERT ... ON CONFLICT UPDATE/IGNORE 4.0 - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: INSERT ... ON CONFLICT UPDATE/IGNORE 4.0
Date
Msg-id 554CF44B.3080808@iki.fi
Whole thread Raw
In response to Re: INSERT ... ON CONFLICT UPDATE/IGNORE 4.0  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: INSERT ... ON CONFLICT UPDATE/IGNORE 4.0
List pgsql-hackers
On 05/08/2015 08:25 PM, Tom Lane wrote:
> Andres Freund <andres@anarazel.de> writes:
>> On 2015-05-08 12:32:10 -0400, Tom Lane wrote:
>>> Looks like there's a CLOBBER_CACHE_ALWAYS issue ...
>>> http://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=jaguarundi&dt=2015-05-08%2011%3A52%3A00
>
>> Currently index inferrence ignores indexes that aren't yet valid
>> according to checkxmin. I'm tempted to think that is a mistake. I think
>> we should throw an error instead; possbily at execution rather than plan
>> time.
>
> If that's what is happening, then throwing an error is not going to fix
> the problem of the regression test results being unstable; it'll just be
> a different error that might or might not get thrown depending on timing.

Why does INSERT ON CONFLICT pay attention to indcheckxmin? Uniqueness 
check only cares about the most recent committed version of the tuple, 
and the index good for that use immediately. If there was a problem 
there, the uniqueness check in a normal insert have the same problem.

- Heikki




pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: INSERT ... ON CONFLICT UPDATE/IGNORE 4.0
Next
From: Andres Freund
Date:
Subject: Re: INSERT ... ON CONFLICT UPDATE/IGNORE 4.0