On Tue, Jul 25, 2023 at 3:07 PM Isaac Morland <isaac.morl...@gmail.com> wrote: > OK, I suppose ALTER CONSTRAINT to change the deferrable status and validity > (that is why we're doing this, right?) needs the constraint name. But the > constraint name is formulaic by default, and my proposal is to suppress it > only when it matches the formula, so you could just construct the constraint > name using the documented formula if it's not explicitly listed. > > 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" designations in 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