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 →
  1. Add error_on_null(), checking if the input is the null value

  2. SQL-standard function body

Attachments

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