Re: BUG #16768: PostgreSQL 12.5 - INSERT ON CONFLICT succeeds on data INSERT but does nothing on UPDATE

Поиск
Список
Период
Сортировка
От Peter Geoghegan
Тема Re: BUG #16768: PostgreSQL 12.5 - INSERT ON CONFLICT succeeds on data INSERT but does nothing on UPDATE
Дата
Msg-id CAH2-WznB6FZCQG2F3hiBvPFkfYuGrvhuH0qDjRCJWWMuQ8k7gg@mail.gmail.com
обсуждение исходный текст
Ответ на BUG #16768: PostgreSQL 12.5 - INSERT ON CONFLICT succeeds on data INSERT but does nothing on UPDATE  (PG Bug reporting form <noreply@postgresql.org>)
Ответы Re: BUG #16768: PostgreSQL 12.5 - INSERT ON CONFLICT succeeds on data INSERT but does nothing on UPDATE  (QA Collective <theqacollective@gmail.com>)
Список pgsql-bugs
On Tue, Dec 8, 2020 at 5:02 PM PG Bug reporting form
<noreply@postgresql.org> wrote:
> The SQL below recreates my issue.  That is, the LAST insert statement DOES
> NOT update the accountinfo_test table value for 'balance' to 200.0 ... it
> remains at the previous value of 100.0.

I think that you need to UPDATE using the excluded.* pseudo table. For
example, "SET my_col = excluded.my_col". As things stand you're using
the target table itself. Technically the row is being updated, but
with the wrong values (the existing values rather than your intended
new successor values).

-- 
Peter Geoghegan



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

Предыдущее
От: PG Bug reporting form
Дата:
Сообщение: BUG #16768: PostgreSQL 12.5 - INSERT ON CONFLICT succeeds on data INSERT but does nothing on UPDATE
Следующее
От: QA Collective
Дата:
Сообщение: Re: BUG #16768: PostgreSQL 12.5 - INSERT ON CONFLICT succeeds on data INSERT but does nothing on UPDATE