Parameter NOT NULL to CREATE DOMAIN not the same as CHECK (VALUE IS NOT NULL)

Поиск
Список
Период
Сортировка
От PG Doc comments form
Тема Parameter NOT NULL to CREATE DOMAIN not the same as CHECK (VALUE IS NOT NULL)
Дата
Msg-id 173591158454.714.7664064332419606037@wrigleys.postgresql.org
обсуждение исходный текст
Список 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 по дате отправления: