Re: MERGE RETURNING

Поиск
Список
Период
Сортировка
От Simon Riggs
Тема Re: MERGE RETURNING
Дата
Msg-id CANbhV-EXmw9i4YhJTgsrLrE-JgUH55MJo6SLCt12mbXjPGuoLA@mail.gmail.com
обсуждение исходный текст
Ответ на MERGE RETURNING  (Miles Elam <miles.elam@productops.com>)
Список pgsql-general
On Wed, 23 Nov 2022 at 19:03, Miles Elam <miles.elam@productops.com> wrote:
>
> Are there any plans to (or specific decisions not to) support a RETURNING clause on MERGE statements in future
versionsof Postgres? The only reference I could find in the mailing list archives was this comment, which suggested it
wasdesired but simply not technically feasible at the time. 
>
> https://www.postgresql.org/message-id/202203161918.qz6phlortw2w@alvherre.pgsql
>
> e.g.
>
> MERGE INTO customer_account ca
> USING (SELECT customer_id, transaction_value FROM recent_transactions) AS t
> ON t.customer_id = ca.customer_id
> WHEN MATCHED THEN
>   UPDATE SET balance = balance + transaction_value
> WHEN NOT MATCHED THEN
>   INSERT (customer_id, balance)
>   VALUES (t.customer_id, t.transaction_value)
> RETURNING customer_account.*;

I think the only issue was getting the work done in the time available.

I don't see any problems with that as a feature, but AFAIK there are
no plans for that.

--
Simon Riggs                http://www.EnterpriseDB.com/



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

Предыдущее
От: Miles Elam
Дата:
Сообщение: MERGE RETURNING
Следующее
От: Danny Shemesh
Дата:
Сообщение: Re: Index filter instead of index condition w/ IN / ANY queries above certain set size