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

From Justin Pryzby
Subject Re: cataloguing NOT NULL constraints
Date
Msg-id 20230301223214.GC4268@telsasoft.com
Whole thread Raw
In response to Re: cataloguing NOT NULL constraints  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
List pgsql-hackers
On Tue, Feb 28, 2023 at 08:15:37PM +0100, Alvaro Herrera wrote:
> Since nobody liked the idea of listing the constraints in psql \d's
> footer, I changed \d+ so that the "not null" column shows the name of
> the constraint if there is one, or the string "(primary key)" if the
> attnotnull marking for the column comes from the primary key.  The new
> column is going to be quite wide in some cases; if we want to hide it
> further, we could add the mythical \d++ and have *that* list the
> constraint name, keeping \d+ as current.

One concern here is that the title "NOT NULL Constraint" is itself
pretty wide, which is an issue for tables which have no not-null
constraints.

On Wed, Mar 01, 2023 at 01:03:48PM +0100, Alvaro Herrera wrote:
> Hmm, so it turned out that cfbot didn't like this because I didn't patch
> one of the compression.out alternate files.  Fixed here.  I think in the
> future I'm not going to submit the 0003 patch, because it's not very
> interesting while being way too bulky and also the one most likely to
> have conflicts.

I like \dt++, and it seems like the obvious thing to do here, to avoid
changing lots of regression test output, which seems worth avoiding in
any case, due to ensuing conflicts in other patches being developed, and
in backpatching.

Right now, \dt+ includes a bit too much output, including things like
sizes, which makes it hard to test.  Moving some things into \dt++ would
make \dt+ more testable (and more usable BTW).  Even if that's not true
of (or not a good idea) for \dt+, I'm sure it applies to other slash
commands.  Currently, fourty-five (45) psql commands support verbose
"plus" variants, and the sql regression tests exercise fifteen (15) of
them.

I proposed \dn++, \dA++, and \db++ in 2ndary patches here:
https://commitfest.postgresql.org/42/3256/

I've considered sending a patch with "plusplus" commands as 001, to
propose that on its own merits rather than in the context of \d[Abn]++

-- 
Justin



pgsql-hackers by date:

Previous
From: Jeff Davis
Date:
Subject: Re: Non-superuser subscription owners
Next
From: Andres Freund
Date:
Subject: Re: refactoring relation extension and BufferAlloc(), faster COPY