Re: MERGE ... RETURNING

Поиск
Список
Период
Сортировка
От Dean Rasheed
Тема Re: MERGE ... RETURNING
Дата
Msg-id CAEZATCWv2JD7ZTx+pfFSw-GtThk5uHE4LyjoRY0r5KakvcgxfQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: MERGE ... RETURNING  (Vik Fearing <vik@postgresfriends.org>)
Ответы Re: MERGE ... RETURNING  (Dean Rasheed <dean.a.rasheed@gmail.com>)
Список pgsql-hackers
On Mon, 9 Jan 2023 at 16:23, Vik Fearing <vik@postgresfriends.org> wrote:
>
> Bikeshedding here.  Instead of Yet Another WITH Clause, could we perhaps
> make a MERGING() function analogous to the GROUPING() function that goes
> with grouping sets?
>
> MERGE ...
> RETURNING *, MERGING('clause'), MERGING('action');
>

Hmm, possibly, but I think that would complicate the implementation quite a bit.

GROUPING() is not really a function (in the sense that there is no
pg_proc entry for it, you can't do "\df grouping", and it isn't
executed with its arguments like a normal function). Rather, it
requires special-case handling in the parser, through to the executor,
and I think MERGING() would be similar.

Also, it masks any user function with the same name, and would
probably require MERGING to be some level of reserved keyword.

I'm not sure that's worth it, just to have a more standard-looking
RETURNING list, without a WITH clause.

Regards,
Dean



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

Предыдущее
От: Nathan Bossart
Дата:
Сообщение: Re: suppressing useless wakeups in logical/worker.c
Следующее
От: Nathan Bossart
Дата:
Сообщение: Re: add \dpS to psql