pg_get_constraintdef throws SQL Error [XX000]: ERROR: invalid constraint type "n" (PG17)

Started by Pierre-Paul Hackensalmost 2 years ago2 messagesbugs

Thread notes

1 note#bug
hackorum-bot#bug
hackorum-bot
1 day ago

@global #bug

#bug
Jump to latest
#1Pierre-Paul Hackens
pierre-paul@geopostcodes.com

Dear support team,

I am writing to report a bug I encountered with the pg_get_constraintdef
function:

CREATE DOMAIN not_null AS TEXT NOT NULL;

CREATE TABLE a (

col not_null

);

SELECT *, pg_get_constraintdef(oid)

FROM pg_constraint

WHERE contype = 'n';

SQL Error [XX000]: ERROR: invalid constraint type "n"

In PG 16 it was ok.
Thank you for your attention to this matter.

Sincerely,
Pierre-Paul

#2Alvaro Herrera
alvherre@alvh.no-ip.org
In reply to: Pierre-Paul Hackens (#1)
Re: pg_get_constraintdef throws SQL Error [XX000]: ERROR: invalid constraint type "n" (PG17)

On 2025-Feb-06, Pierre-Paul Hackens wrote:

Dear support team,

I am writing to report a bug I encountered with the pg_get_constraintdef
function:

SELECT *, pg_get_constraintdef(oid)
FROM pg_constraint
WHERE contype = 'n';

SQL Error [XX000]: ERROR: invalid constraint type "n"

Hello, thanks for reporting this. It was reported previously and
already fixed; the fix will be in 17.3, to be released next week.

--
Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/