On Wed, Aug 17, 2022 at 2:12 PM Alvaro Herrera <alvhe...@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