Re: Per row status during INSERT .. ON CONFLICT UPDATE?

Поиск
Список
Период
Сортировка
От Robins Tharakan
Тема Re: Per row status during INSERT .. ON CONFLICT UPDATE?
Дата
Msg-id CAEP4nAyFfgLm=9sx+93LPrqd41ODenuYjip0eiTJ6kGHAYQ70g@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Per row status during INSERT .. ON CONFLICT UPDATE?  (Peter Geoghegan <pg@heroku.com>)
Ответы Re: Per row status during INSERT .. ON CONFLICT UPDATE?  (Peter Geoghegan <pg@heroku.com>)
Список pgsql-hackers

On 19 May 2015 at 23:24, Peter Geoghegan <pg@heroku.com> wrote:
That's certainly something we talked about. It could probably be done
with some kind of magical expression. I have to wonder how many of the
people that are sure that they need this really do, though. Is it
really natural to care about this distinction with idiomatic usage?

Thanks everyone for responding promptly.

​Not sure if I can be authoritative for many, but for me, the need emanates from having to move an ETL off MSSQL Server, which supports OUTPUT $action (similar to RETURNING * in Postgres​) where $action is the per-row status (INSERT / UPDATE).

My use-case is to create an extra row for all UPDATEd rows (only), which is implemented in MSSQL by enveloping the MERGE with an INSERT (MERGE ... OUTPUT $action) WHERE $action = 'UPDATE'. 

Am still to test, but looks like Thom's reply earlier could take care of my use-case, so we may need more people requesting this magic field, with a valid use-case.

--
Robins Tharakan

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

Предыдущее
От: Geoff Winkless
Дата:
Сообщение: Re: INSERT ... ON CONFLICT DO UPDATE with _any_ constraint
Следующее
От: Peter Geoghegan
Дата:
Сообщение: Re: INSERT ... ON CONFLICT DO UPDATE with _any_ constraint