Re: ON CONFLICT DO NOTHING RETURNING

Поиск
Список
Период
Сортировка
От Peter Geoghegan
Тема Re: ON CONFLICT DO NOTHING RETURNING
Дата
Msg-id CAH2-WzmuYnC_6Mdro7X_2ipwt3TCgA0FrS52-99xQ6jSiRf2tA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: ON CONFLICT DO NOTHING RETURNING  (Jeff Janes <jeff.janes@gmail.com>)
Список pgsql-general
On Fri, Mar 18, 2016 at 9:14 AM, Jeff Janes <jeff.janes@gmail.com> wrote:
> He wants to retrieve a value from the conflicting row.  Now getting
> the value that caused the conflict should be easy, because you
> provided it in the first place.   But he wants a value from a
> different column of the conflicting row than the column(s) on which
> there is conflict.  DO NOTHING RETURNING returns no rows.  Which is
> reasonable, because nothing was inserted.  But it isn't what he wants.

I see.

> I think the dummy update is his best bet, but it does seem like there
> should be a better way.  Maybe ON CONFLICT DO SELECT where the select
> operates over the target row.

Seems reasonable.


--
Peter Geoghegan


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

Предыдущее
От:
Дата:
Сообщение: Re: Question about shared_buffer cache behavior
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: grant select on pg_stat_activity