Re: BUG #17464: Domain type. If the value field(CREATE DOMAIN) is set to null, errors cannot be intercepted. - Mailing list pgsql-bugs

From David G. Johnston
Subject Re: BUG #17464: Domain type. If the value field(CREATE DOMAIN) is set to null, errors cannot be intercepted.
Date
Msg-id CAKFQuwYwhyZDkR2RmQ8ns7p=gVjBumU_Broh_VC9JMTkOpcotA@mail.gmail.com
Whole thread Raw
In response to BUG #17464: Domain type. If the value field(CREATE DOMAIN) is set to null, errors cannot be intercepted.  (PG Bug reporting form <noreply@postgresql.org>)
Responses Re: BUG #17464: Domain type. If the value field(CREATE DOMAIN) is set to null, errors cannot be intercepted.
List pgsql-bugs
On Tue, Apr 12, 2022 at 7:16 AM PG Bug reporting form <noreply@postgresql.org> wrote:
The following bug has been logged on the website:

Bug reference:      17464
Logged by:          Domain type. If the value field(CREATE DOMAIN) is set to null, errors cannot
be intercepted.
Email address:      dafoer_x@163.com
PostgreSQL version: 13.2
Operating system:   centos7.6 x86
Description:       

Domain type. If the value field(CREATE DOMAIN) is set to null, errors cannot
be intercepted.
Because texteq cannot accept null input parameters,
op->d.domainCheck.checknull is set to the wrong value .

I'm not really following, and don't have time to investigate this right now, but:

CREATE DOMAIN xb AS TEXT CHECK
(
   VALUE = '男'
   OR VALUE ='女'
   OR VALUE = null
 );


"VALUES = null" is simply wrong.  That isn't how one checks for null.  Use "IS NULL".  If that restores the correct behavior I'm unsure what we'd be willing to do to behave differently in the presence of the improper null test form.

David J.

pgsql-bugs by date:

Previous
From: PG Bug reporting form
Date:
Subject: BUG #17464: Domain type. If the value field(CREATE DOMAIN) is set to null, errors cannot be intercepted.
Next
From: Tom Lane
Date:
Subject: Re: BUG #17464: Domain type. If the value field(CREATE DOMAIN) is set to null, errors cannot be intercepted.