Re: INSERT ... ON CONFLICT UPDATE/IGNORE 4.0

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Re: INSERT ... ON CONFLICT UPDATE/IGNORE 4.0
Дата
Msg-id 20150506201604.GB12506@alap3.anarazel.de
обсуждение исходный текст
Ответ на Re: INSERT ... ON CONFLICT UPDATE/IGNORE 4.0  (Heikki Linnakangas <hlinnaka@iki.fi>)
Список pgsql-hackers
On 2015-05-06 22:51:43 +0300, Heikki Linnakangas wrote:
> 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.

If you want to do something more complicated with the row than what you
can do in the UPDATE. To do that right now you either need to do the DO
UPDATE SET ... WHERE false; and refetch the tuple which might not be
easy, or do a DO UPDATE SET pkey = target.pkey which produces
bloat. Consider e.g. you're applying incoming data and in case of
conflict you want to call user defined function deciding which row
should survive.

Greetings,

Andres Freund



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Peter Geoghegan
Дата:
Сообщение: Re: INSERT ... ON CONFLICT syntax issues
Следующее
От: Robert Haas
Дата:
Сообщение: Re: Disabling trust/ident authentication configure option