Re: Error with Insert from View with ON Conflict

Поиск
Список
Период
Сортировка
От Peter Geoghegan
Тема Re: Error with Insert from View with ON Conflict
Дата
Msg-id CAH2-Wzm7=qhf3itAzmCGPyKOqW14aseiHtj7eNue6NXN8HyYnw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Error with Insert from View with ON Conflict  (Steve Baldwin <steve.baldwin@gmail.com>)
Ответы Re: Error with Insert from View with ON Conflict
Список pgsql-general
On Wed, Nov 3, 2021 at 2:18 PM Steve Baldwin <steve.baldwin@gmail.com> wrote:
> I'm pretty sure the 'alias' for the '.. on conflict do update ..' needs to be 'excluded' (i.e. checks =
excluded.checks,...). Check the docs.
 

That's right . The excluded.* pseudo-table isn't exactly the same
thing as the target table -- it is a tuple that has the same "shape",
that represents what the implementation tried (and failed) to insert
into the table. I have to imagine that Alex wants to reference that,
because that's the standard idiomatic approach with ON CONFLICT. And
because the only alternative interpretation is that Alex intends to
update those columns using their current values (not new values),
which won't really change anything -- that seems unlikely to have been
the intent.

-- 
Peter Geoghegan



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

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: to_date() and to_timestamp() with negative years
Следующее
От: Bryn Llewellyn
Дата:
Сообщение: Re: to_date() and to_timestamp() with negative years