Re: [PATCH] Add error_on_null() to produce an error if the input is null

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Vik Fearing <vik(at)postgresfriends(dot)org>
Cc: Joel Jacobson <joel(at)compiler(dot)org>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH] Add error_on_null() to produce an error if the input is null
Date: 2025-08-30 16:38:55
Message-ID: 14753.1756571935@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Vik Fearing <vik(at)postgresfriends(dot)org> writes:
> On 30/08/2025 13:49, Joel Jacobson wrote:
>> This polymorphic function produces an error if the input value is null,
>> otherwise it returns the input value unchanged.

> This only checks for the null value. I don't think we need to change
> the function's name, but we do need to be more precise in the
> documentation that it checks for the null value and not values that are
> null.

Agreed. You might be able to borrow some wording from the docs'
discussion of the IS [NOT] NULL construct, and/or IS DISTINCT FROM.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2025-08-30 16:52:45 Re: PG 18 relnotes and RC1
Previous Message Bruce Momjian 2025-08-30 16:38:06 PG 18 relnotes and RC1