Re: Assert single row returning SQL-standard functions

David G. Johnston <david.g.johnston@gmail.com>

From: "David G. Johnston" <david.g.johnston@gmail.com>
To: Joel Jacobson <joel@compiler.org>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2025-08-29T14:07:39Z
Lists: pgsql-hackers

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Add error_on_null(), checking if the input is the null value

  2. SQL-standard function body

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.