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

From: Vik Fearing <vik(at)postgresfriends(dot)org>
To: 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 12:52:20
Message-ID: 088852ea-9c24-46f4-9981-9d961f226500@postgresfriends.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On 30/08/2025 13:49, Joel Jacobson wrote:
> Dear fellow hackers,
>
> 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.

Perhaps replacing "Produces an error if the input is null, and returns
the input otherwise." with "Produces an error if the input is the null
value, and returns the input otherwise."

Then also add ROW(NULL, NULL)) to the regressions tests showing that we
are aware that that is the behavior for things that are null but are not
the null value.

--

Vik Fearing

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alexander Lakhin 2025-08-30 13:00:01 Re: Correction of RowMark Removal During Sel-Join Elimination
Previous Message Joel Jacobson 2025-08-30 11:49:48 [PATCH] Add error_on_null() to produce an error if the input is null