Re: [PATCH] Add error_on_null() to produce an error if the input is null - Mailing list pgsql-hackers

From Joel Jacobson
Subject Re: [PATCH] Add error_on_null() to produce an error if the input is null
Date
Msg-id 1b7b5490-5549-4447-82fe-432efc6f3f4a@app.fastmail.com
Whole thread Raw
In response to Re: [PATCH] Add error_on_null() to produce an error if the input is null  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [PATCH] Add error_on_null() to produce an error if the input is null
List pgsql-hackers
On Sat, Aug 30, 2025, at 18:38, Tom Lane wrote:
> Vik Fearing <vik@postgresfriends.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

Thanks for great feedback. New patch attached.

/Joel

Attachment

pgsql-hackers by date:

Previous
From: "Jonathan S. Katz"
Date:
Subject: Re: PG 18 relnotes and RC1
Next
From: Mikael Kjellström
Date:
Subject: Re: ecpg test thread/alloc hangs on sidewinder running NetBSD 9.3