Re: Promise index tuples for UPSERT - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: Promise index tuples for UPSERT
Date
Msg-id 54328A31.4000501@vmware.com
Whole thread Raw
In response to Re: Promise index tuples for UPSERT  (Heikki Linnakangas <hlinnakangas@vmware.com>)
List pgsql-hackers
On 10/06/2014 03:21 PM, Heikki Linnakangas wrote:
> On 10/06/2014 03:05 PM, Simon Riggs wrote:
>> My understanding of what you're saying is that if
>>
>> * we have a table with >1 unique index
>> * and we update the values of the uniquely index columns (e.g. PK update)
>> * on both of the uniquely indexed column sets
>> then we get occaisonal deadlocks, just as we would do using current
>> UPDATE/INSERT.
>
> Right. To be precise: you don't need to update both of the columns in
> the same transaction, it's enough that some of the concurrent
> transactions update one column, while other transactions update the
> other column.

Ok, that didn't make much sense. With UPSERT, you have to specify values 
for both columns. But it's sufficient that you have a mix of 
transactions where only some are UPSERTs, and others are regular UPDATEs 
on one of the columns.

- Heikki




pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: Promise index tuples for UPSERT
Next
From: Michael Paquier
Date:
Subject: Re: WAL format and API changes (9.5)