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

From: Pierre-Paul Hackens <pierre-paul(at)geopostcodes(dot)com>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: pg_get_constraintdef throws SQL Error [XX000]: ERROR: invalid constraint type "n" (PG17)
Date: 2025-02-06 10:10:43
Message-ID: CAJd6cTJRYd7uimJkkSSNd-XZx3YH5kRShYRiRaxcgT9i=cxFcg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

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

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message PG Bug reporting form 2025-02-06 11:28:22 BUG #18797: pointer te->defn not checked for NULL
Previous Message Mor Lehr 2025-02-06 10:10:26 Re: Missing semicolumn in anonymous plpgsql block does not raise syntax error