Re: INSERT ... ON CONFLICT DO UPDATE with _any_ constraint

Поиск
Список
Период
Сортировка
От Simon Riggs
Тема Re: INSERT ... ON CONFLICT DO UPDATE with _any_ constraint
Дата
Msg-id CANP8+jJEW6aapVMhTXkibp1Tccz-7PNO=uv6ucfbvrQx4ms7Ww@mail.gmail.com
обсуждение исходный текст
Ответ на Re: INSERT ... ON CONFLICT DO UPDATE with _any_ constraint  (Peter Geoghegan <pg@heroku.com>)
Ответы Re: INSERT ... ON CONFLICT DO UPDATE with _any_ constraint  (Peter Geoghegan <pg@heroku.com>)
Список pgsql-hackers
On 19 May 2015 at 17:10, Peter Geoghegan <pg@heroku.com> wrote:
On Tue, May 19, 2015 at 1:57 PM, Simon Riggs <simon@2ndquadrant.com> wrote:
> We should allow DO UPDATE to exclude a constraint and apply a deterministic
> order to the constraints. 1. PK if it exists. 2. Replica Identity, when not
> PK, 3. UNIQUE constraints in name order, like triggers, so users can define
> a default evaluation order, just like they do with triggers.

That seems like something way worse than just allowing it for all constraints.

I'm talking about the evaluation order; it would still match all constraints, otherwise they wouldn't be constraints.

> 2) Compatibility with MySQL

But what you describe isn't compatible with MySQL. It's totally novel.

Upthread you said

"It's trivial to modify Postgres to not require that a specific unique
index be inferred, so that you can omit the inference specification
for DO UPDATE just as you can for DO NOTHING. That would make it work
in a similar way to MySQL"

Similar is good and useful. Full compatibility is even better.

--
Simon Riggs                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

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

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: Minor ON CONFLICT related fixes
Следующее
От: "Joshua D. Drake"
Дата:
Сообщение: Rewriting backup.sgml (patch attached)