pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Pg Hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: cataloguing NOT NULL constraints
Date: Tue, 20 Sep 2022 12:51:09 +0200
Message-ID: <20220920105109.kopdp7wmlkfi5ci5@alvherre.pgsql> (raw)
In-Reply-To: <CA+Tgmobnoxt83y1QesBNVArhFm-fLwWkDUyiV84e+psayDwB7A@mail.gmail.com>

On 2022-Sep-19, Robert Haas wrote:

> On Wed, Aug 17, 2022 at 2:12 PM Alvaro Herrera <alvherre@alvh.no-ip.org> wrote:

> > 55489 16devel 1776237=# \d tab
> >                     Tabla «public.tab»
> >  Columna │  Tipo   │ Ordenamiento │ Nulable  │ Por omisión
> > ─────────┼─────────┼──────────────┼──────────┼─────────────
> >  a       │ integer │              │ not null │
> > Restricciones CHECK:
> >     "tab_a_not_null" CHECK (a IS NOT NULL)
> 
> In a table with many columns, most of which are NOT NULL, this is
> going to produce a ton of clutter. I don't like that.
> 
> I'm not sure what a good alternative would be, though.

Perhaps that can be solved by displaying the constraint name in the
table:

 55489 16devel 1776237=# \d tab
                     Tabla «public.tab»
  Columna │  Tipo   │ Ordenamiento │     Nulable    │ Por omisión
 ─────────┼─────────┼──────────────┼────────────────┼─────────────
  a       │ integer │              │ tab_a_not_null │ 

(Perhaps we can change the column title also, not sure.)

-- 
Álvaro Herrera        Breisgau, Deutschland  —  https://www.EnterpriseDB.com/
"The Gord often wonders why people threaten never to come back after they've
been told never to return" (www.actsofgord.com)





view thread (196+ messages)  latest in thread

Message-ID: <20220920105109.kopdp7wmlkfi5ci5@alvherre.pgsql>
Permalink:  ../20220920105109.kopdp7wmlkfi5ci5@alvherre.pgsql/
Also on:    postgresql.org/message-id/20220920105109.kopdp7wmlkfi5ci5@alvherre.pgsql

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: alvherre@alvh.no-ip.org, robertmhaas@gmail.com, pgsql-hackers@lists.postgresql.org
  Subject: Re: cataloguing NOT NULL constraints
  In-Reply-To: <20220920105109.kopdp7wmlkfi5ci5@alvherre.pgsql>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox