Re: INSERT ... ON CONFLICT syntax issues

Поиск
Список
Период
Сортировка
От Geoff Winkless
Тема Re: INSERT ... ON CONFLICT syntax issues
Дата
Msg-id CAEzk6fcevLR82Sdr8Cd0Tp9XkLbzKSGyNYng7SM+JaT10pWhjw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: INSERT ... ON CONFLICT syntax issues  (Stephen Frost <sfrost@snowman.net>)
Ответы Re: INSERT ... ON CONFLICT syntax issues  (Geoff Winkless <pgsqladmin@geoff.dj>)
Список pgsql-hackers
On 28 April 2015 at 15:46, Stephen Frost <sfrost@snowman.net> wrote:
+1, NEW/OLD seem pretty natural and I'm not worried about what they look
like in rules, and their usage in triggers matches up with what they'd
mean here, I'd think.
 
Since I've stuck my head above the parapet once I figured I'd give m
y 2p's worth:
​IMHO ​
NEW/OLD doesn't fit at all. 

In triggers you're applying it to something that (without the trigger) would be the new or old version of a matching row
​, so it's completely intuitive​
; in this instance without the ON CONFLICT there would never be a
​"​
new
​"​
, because it would be
​a ​
failure
​​
.
​​

​MySQL uses VALUES(columnname) to reference the intended INSERT value (what you might term "NEW") and the target name to reference "OLD". I understand that people might think the bracketed syntax isn't very pleasant because that looks like a function, but it seems more reasonable than NEW (can we use VALUES.columname?); finally I don't see why we need an "OLD" (or TARGET) at all - am I missing the point?

Geoff


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

Предыдущее
От: David Steele
Дата:
Сообщение: Re: Proposal: knowing detail of config files via SQL
Следующее
От: Geoff Winkless
Дата:
Сообщение: Re: INSERT ... ON CONFLICT syntax issues