Re: Assert single row returning SQL-standard functions
Joel Jacobson <joel@compiler.org>
From: "Joel Jacobson" <joel@compiler.org>
To: "Pavel Stehule" <pavel.stehule@gmail.com>
Cc: "Vik Fearing" <vik@postgresfriends.org>,
pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2025-08-29T20:01:18Z
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 →
-
Add error_on_null(), checking if the input is the null value
- 2b75c38b707a 19 (unreleased) landed
-
SQL-standard function body
- e717a9a18b2e 14.0 cited
Attachments
- 0001-Add-nonnull-function-to-reject-null-values.patch (application/octet-stream) patch 0001
On Fri, Aug 29, 2025, at 19:27, Pavel Stehule wrote: > pá 29. 8. 2025 v 18:51 odesílatel Joel Jacobson <joel@compiler.org> napsal: >> In the meantime, maybe we want to add a catalog function >> nonnull(anyelement) -> anyelement that throws an error if the input is >> NULL? Seems like a function that could be useful in general. >> Attached a small patch that adds such a function. > > +1 New version attached. Added docs and tests. Wasn't sure where to put the docs. It's kinda a comparison function, since we compare against NULL internally? I put the docs in func-comparison.sgml, please advise if some other file would be better. > Orafce introduces https://github.com/orafce/orafce: > > PLUnit > > <https://github.com/orafce/orafce#plunit> > This unit contains some assert functions. Nice, that looks like an impressive collection of lots of useful functions, thanks, will check it out. /Joel