Parameter NOT NULL to CREATE DOMAIN not the same as CHECK (VALUE IS NOT NULL) - Mailing list pgsql-docs

From PG Doc comments form
Subject Parameter NOT NULL to CREATE DOMAIN not the same as CHECK (VALUE IS NOT NULL)
Date
Msg-id 173591158454.714.7664064332419606037@wrigleys.postgresql.org
Whole thread Raw
List pgsql-docs
The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/17/sql-createdomain.html
Description:

The manual claims:

The syntax NOT NULL in this command is a PostgreSQL extension. (A
standard-conforming way to write the same would be CHECK (VALUE IS NOT
NULL). […])

But both variants differ when composite types are involved:

CREATE TYPE complex AS (real float8, imag float8);

CREATE DOMAIN d1 AS complex NOT NULL;
CREATE DOMAIN d2 AS complex CHECK (VALUE IS NOT NULL);

SELECT '(,)'::d1; -- allowed
SELECT '(,)'::d2; -- not allowed

Kind Regards,
Jan Behrens

pgsql-docs by date:

Previous
From: PG Doc comments form
Date:
Subject: LC_COLLATE is visible in the documentation for PostgreSQL 17, but it is not supported
Next
From: jian he
Date:
Subject: Re: LC_COLLATE is visible in the documentation for PostgreSQL 17, but it is not supported