On 05/06/2015 09:51 PM, Heikki Linnakangas wrote:
So, yes, DO NOTHING does very little - and that is its appeal.
Supporting this behavior does not short change those who actually care
about the existing tuple sticking around for the duration of their
transaction - they have a way of doing that. If you want to document
INSERT IGNORE as being primarily an ETL-orientated thing, that would
make sense, but let's not hobble that use case.
Yeah, I agree that DO NOTHING should not lock the rows. It might make
sense to have a DO LOCK variant, which locks the rows, although I don't
immediately see what the use case would be.
It seems like a very useful feature to me, if you want to upsert
something into a table with a serial column and get the value of the
serial column in a RETURNING clause (but not update any fields if there
is a conflict). Then I am pretty sure I want to lock the row.
Andreas
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers