Re: information_schema and not-null constraints - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: information_schema and not-null constraints
Date
Msg-id c583dc24-e4e4-fb65-102e-25e7258943a8@eisentraut.org
Whole thread Raw
In response to Re: information_schema and not-null constraints  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
List pgsql-hackers
On 05.09.23 18:24, Alvaro Herrera wrote:
> On 2023-Sep-05, Peter Eisentraut wrote:
> 
>> The following information schema views are affected by the not-null
>> constraint catalog entries:
>>
>> 1. CHECK_CONSTRAINTS
>> 2. CONSTRAINT_COLUMN_USAGE
>> 3. DOMAIN_CONSTRAINTS
>> 4. TABLE_CONSTRAINTS
>>
>> Note that 1 and 3 also contain domain constraints.
> 
> After looking at what happens for domain constraints in older versions
> (I tested 15, but I suppose this applies everywhere), I notice that we
> don't seem to handle them anywhere that I can see.  My quick exercise is
> just
> 
> create domain nnint as int not null;
> create table foo (a nnint);
> 
> and then verify that this constraint shows nowhere -- it's not in
> DOMAIN_CONSTRAINTS for starters, which is I think the most obvious place.
> And nothing is shown in CHECK_CONSTRAINTS nor TABLE_CONSTRAINTS either.
> 
> This did ever work in the past?  I tested with 9.3 and didn't see
> anything there either.

No, this was never implemented.  (As I wrote in my other message on the 
other thread, arguably a bit buggy.)  We could fix this separately, 
unless we are going to implement catalogued domain not-null constraints 
soon.




pgsql-hackers by date:

Previous
From: vignesh C
Date:
Subject: Re: pg_upgrade and logical replication
Next
From: Yugo NAGATA
Date:
Subject: Re: pgbnech: allow to cancel queries during benchmark