"David G. Johnston" <david.g.johnston@gmail.com> writes:
> "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.
There's already transform_null_equals, which does work if you turn it on
while executing this incorrect CREATE DOMAIN command. But the better
answer is to fix your SQL.
regression=# set transform_null_equals = 1;
SET
regression=# CREATE DOMAIN xb AS TEXT CHECK
regression-# (
regression(# VALUE = '男'
regression(# OR VALUE ='女'
regression(# OR VALUE = null
regression(# );
CREATE DOMAIN
regression=# \dD+ xb
List of domains
Schema | Name | Type | Collation | Nullable | Default | Check
| Access privileges | Description
--------+------+------+-----------+----------+---------+--------------------------------------------------------------------+-------------------+-------------
public | xb | text | | | | CHECK (VALUE = '男'::text OR VALUE = '女'::text OR VALUE IS
NULL)| |
(1 row)
regards, tom lane