Re: INSERT ... ON CONFLICT DO UPDATE

Поиск
Список
Период
Сортировка
От Geoff Winkless
Тема Re: INSERT ... ON CONFLICT DO UPDATE
Дата
Msg-id CAEzk6fepiS6Cd4pUfKCp5edzYJoTUjysboNdy=U5_H-hX=UnBw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: INSERT ... ON CONFLICT DO UPDATE  (Rafal Pietrak <rafal@ztk-rp.eu>)
Список pgsql-general

On 21 July 2015 at 11:43, Rafal Pietrak <rafal@ztk-rp.eu> wrote:
On the other hand, the "ON CONFLICT RETRY" has a nice feature for an
application programmer (like myself) that it leaves us free of the
implementation of the re-issue of an INSERT. One database-schema
designer does that for all of us.

But knowing if that usage scenario is too rare to match the heavy
lifting the implementation required, is beyond my experience.

The usage scenario is rare and I'm sure that doesn't help you but the point is that it's very very easy to write a function that does what you want. It's not easy at all to write a function that does UPSERT or DO NOTHING consistently and efficiently.

The fact that you refuse to use the mechanism provided to you by the database developers doesn't invalidate the fact that that's the simplest and easiest way to achieve what you want.

I'm sorry to be harsh (again) about this but adding extra complexity to the PG system to achieve something that is _easily_ achieved through the existing mechanisms isn't something that is likely to get widespread support.

Geoff

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

Предыдущее
От: Rafal Pietrak
Дата:
Сообщение: Re: INSERT ... ON CONFLICT DO UPDATE
Следующее
От: Albe Laurenz
Дата:
Сообщение: Re: Creating a user for pg_start_backup