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

2025-01-08 Thread shammat
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

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

2025-01-08 Thread Alvaro Herrera
On 2025-Jan-08, sham...@gmx.net wrote: Hello, > 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 avoide

Postgres 17 domains with NOT NULL and pg_get_constraintdef()

2025-01-08 Thread shammat
Hello, I am not sure if this is intended behavior or an oversight/bug. Assume the following domain definition: CREATE DOMAIN sample_domain AS numeric(12,2) NOT NULL constraint positive_value CHECK (value > 0); Up until Postgres 16 it was possible to retrieve the domain constraints using: