Re: Postgres 17 domains with NOT NULL and pg_get_constraintdef()

shammat@gmx.net

From: shammat@gmx.net
To: pgsql-general@lists.postgresql.org
Date: 2025-01-08T18:39:25Z
Lists: pgsql-general
Am 08.01.25 um 14:10 schrieb Alvaro Herrera:
>> However, because the domain is defined with NOT NULL, this fails with
>>
>>> ERROR: invalid constraint type "n"
>>
>> with 17.2 on Windows and Linux.
>>
>> This is a result of storing the NOT NULL constraint in pg_constraint
>> and can easily be avoided by either using contype <> 'n' or by not calling
>> pg_get_constraintdef if contype = 'n'
>
> Yeah, thanks for the report -- this is clearly a bug and it was fixed
> already in the 17 branch, but it's not been released yet.  It'll be in
> the February release.

Thanks for the confirmation.





Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Add pg_constraint rows for not-null constraints