Re: cataloguing NOT NULL constraints - Mailing list pgsql-hackers

From Robert Haas
Subject Re: cataloguing NOT NULL constraints
Date
Msg-id CA+TgmoaZcABspMDL26Mb=AUmaEF74E_pN4nGxvwo9v2ea34gAw@mail.gmail.com
Whole thread Raw
In response to Re: cataloguing NOT NULL constraints  (Isaac Morland <isaac.morland@gmail.com>)
List pgsql-hackers
On Tue, Jul 25, 2023 at 3:07 PM Isaac Morland <isaac.morland@gmail.com> wrote:
> OK, I suppose ALTER CONSTRAINT to change the deferrable status and validity (that is why we're doing this, right?)
needsthe constraint name. But the constraint name is formulaic by default, and my proposal is to suppress it only when
itmatches the formula, so you could just construct the constraint name using the documented formula if it's not
explicitlylisted. 
>
> I really don’t see it as a good use of space to add n lines to the \d+ display just to confirm that the "not null"
designationsin the "Nullable" column are implemented by named constraints with the expected names. 

Yeah, I mean, I get that. That was my initial concern, too. But I also
think if there's some complicated rule that determines what gets
displayed and what doesn't, nobody's going to remember it, and then
when you don't see something, you're never going to be sure exactly
what's going on. Displaying everything is going to be clunky
especially if, like me, you tend to be careful to mark columns NOT
NULL when they are, but when something goes wrong, the last thing you
want to do is run a \d command and have it show you incomplete
information.

I can't count the number of times that somebody's shown me the output
of a query against pg_locks or pg_stat_activity that had been filtered
to remove irrelevant information and it turned out that the hidden
information was not so irrelevant as the person who wrote the query
thought. It happens all the time. I don't want to create the same kind
of situation here.

--
Robert Haas
EDB: http://www.enterprisedb.com



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: WAL Insertion Lock Improvements
Next
From: Gurjeet Singh
Date:
Subject: Re: MERGE ... RETURNING