this occurs on postgresql 17.2 and did not occur on any previous version including 16, 15, 14. apologies if this has
alreadybeen reported but I didn't see any means of looking up existing issues
complete steps below
$ psql -U scott -h pg17 test
Password for user scott:
psql (16.3, server 17.2)
WARNING: psql major version 16, server major version 17.
Some psql features might not work.
Type "help" for help.
test=> CREATE DOMAIN not_nullable_domain AS TEXT NOT NULL;
CREATE DOMAIN
test=> SELECT
domain_constraints.condefs, domain_constraints.connames, pg_catalog.pg_collation.collname
FROM pg_catalog.pg_type
JOIN pg_catalog.pg_namespace ON pg_catalog.pg_namespace.oid = pg_catalog.pg_type.typnamespace
LEFT OUTER JOIN pg_catalog.pg_collation ON pg_catalog.pg_type.typcollation = pg_catalog.pg_collation.oid
LEFT OUTER JOIN
(SELECT pg_catalog.pg_constraint.contypid AS contypid,
array_agg(pg_catalog.pg_get_constraintdef(pg_catalog.pg_constraint.oid, true)) AS condefs,
array_agg(CAST(pg_catalog.pg_constraint.conname AS TEXT)) AS connames
FROM pg_catalog.pg_constraint
WHERE pg_catalog.pg_constraint.contypid != 0
GROUP BY pg_catalog.pg_constraint.contypid) AS domain_constraints ON pg_catalog.pg_type.oid =
domain_constraints.contypid
WHERE pg_catalog.pg_type.typtype = 'd' ORDER BY pg_catalog.pg_namespace.nspname, pg_catalog.pg_type.typname;
ERROR: invalid constraint type "n"