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

From Robert Haas
Subject Re: cataloguing NOT NULL constraints
Date
Msg-id CA+Tgmobnoxt83y1QesBNVArhFm-fLwWkDUyiV84e+psayDwB7A@mail.gmail.com
Whole thread Raw
In response to cataloguing NOT NULL constraints  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
Responses Re: cataloguing NOT NULL constraints
Re: cataloguing NOT NULL constraints
Re: cataloguing NOT NULL constraints
List pgsql-hackers
On Wed, Aug 17, 2022 at 2:12 PM Alvaro Herrera <alvherre@alvh.no-ip.org> wrote:
> If you say CREATE TABLE (a int NOT NULL), you'll get a CHECK constraint
> printed by psql: (this is a bit more noisy that previously and it
> changes a lot of regression tests output).
>
> 55489 16devel 1776237=# create table tab (a int not null);
> CREATE TABLE
> 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.

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

pgsql-hackers by date:

Previous
From: Bharath Rupireddy
Date:
Subject: pgstat: stats added in ReadPageInternal() aren't getting reported via pg_stat_wal
Next
From: Isaac Morland
Date:
Subject: Re: cataloguing NOT NULL constraints