Re: Assert single row returning SQL-standard functions

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: Assert single row returning SQL-standard functions
Дата
Msg-id CAKFQuwZ6d8Btqs8k08c-pny-tPAwpRyHX9ChaVSMzVPEBYgogQ@mail.gmail.com
обсуждение исходный текст
Ответ на Assert single row returning SQL-standard functions  ("Joel Jacobson" <joel@compiler.org>)
Список pgsql-hackers
On Friday, August 29, 2025, Joel Jacobson <joel@compiler.org> wrote:

These were just the two first ideas on the top of my head, please share
yours if you see a better way.

I’d love to just add a new clause to select.

Select …
Require {exactly|{more|less}than} row_count

e.g., exactly 1; more than 0, less than 2

No reason to limit this capability to function call outputs especially since we would like to retain inlining when possible.

For insert/delete/update either add it directly there too or at worse you get it via returning into a CTE and attaching “require” to the parent query.

David J.

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