Re: [PATCH] Make ON CONFLICT DO NOTHING and ON CONFLICT DO UPDATE consistent

Поиск
Список
Период
Сортировка
От Aleksander Alekseev
Тема Re: [PATCH] Make ON CONFLICT DO NOTHING and ON CONFLICT DO UPDATE consistent
Дата
Msg-id CAJ7c6TMxN_KP_w=rpp_1y_+Jv77zdF8v-h4=78wSpW7ZDS1VYA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [PATCH] Make ON CONFLICT DO NOTHING and ON CONFLICT DO UPDATE consistent  (Peter Geoghegan <pg@bowt.ie>)
Список pgsql-hackers
Hi Peter,

> It also makes DO UPDATE not work the same way as either UPDATE itself
> (which will silently skip a second or subsequent update of the same
> row by the same UPDATE statement in RC mode), or MERGE (which has
> similar cardinality violations).

That's true. On the flip side, UPDATE and MERGE are different
statements and arguably shouldn't behave the same way INSERT does.

To clarify, I'm merely proposing the change and playing the role of
Devil's advocate here. I'm not arguing that the patch should be
necessarily accepted. In the end of the day it's up to the community
to decide. Personally I think it would make the users a bit happier.

The actual reason why I made the patch is that a colleague of mine,
Sven Klemm, encountered this limitation recently and was puzzled by it
and so was I. The only workaround the user currently has is to execute
several INSERTs one by one which is expensive when you have a lot of
INSERTs.

-- 
Best regards,
Aleksander Alekseev



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

Предыдущее
От: Andrey Chudnovsky
Дата:
Сообщение: Re: Proposal: Support custom authentication methods using hooks
Следующее
От: gkokolatos@pm.me
Дата:
Сообщение: Re: Add LZ4 compression in pg_dump