invalid constraint type "n" when using pg_catalog.pg_get_constraintdef() on pg17, regression from pg16

From: "Mike Bayer" <mike_mp(at)zzzcomputing(dot)com>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: invalid constraint type "n" when using pg_catalog.pg_get_constraintdef() on pg17, regression from pg16
Date: 2024-12-12 14:08:58
Message-ID: a90f53c4-56f3-4b07-aefc-49afdc67dba6@app.fastmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

this occurs on postgresql 17.2 and did not occur on any previous version including 16, 15, 14. apologies if this has already been 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"

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message David G. Johnston 2024-12-12 14:14:24 Re: invalid constraint type "n" when using pg_catalog.pg_get_constraintdef() on pg17, regression from pg16
Previous Message Greg Sabino Mullane 2024-12-12 12:39:40 Re: "memory exhausted" in query parser/simplifier for many nested parentheses