Most system catalog columns should be NOT NULL - Mailing list pgsql-hackers

From Tom Lane
Subject Most system catalog columns should be NOT NULL
Date
Msg-id 8920.1026060368@sss.pgh.pa.us
Whole thread Raw
Responses Re: Most system catalog columns should be NOT NULL  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-hackers
A conversation in pgsql-interfaces reminded me that it would be a good
idea for initdb to try to set attnotnull correctly for columns of the
system catalogs.  Although we generally don't recommend that people
update catalogs directly, it's sometimes done anyway; having NOT NULL
constraints set on the columns that mustn't be null would help make
the system more robust.

It would be fairly easy to make bootstrap.c set attnotnull to true
for any column that's of a fixed-width datatype.  That appears to
solve 99% of the problem with an appropriate amount of effort.
We could imagine inventing some BKI macro to explicitly label nullable
or not-nullable columns in the include/catalog headers, but I don't
think it's worth that much trouble.

Comments?
        regards, tom lane




pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: libpq++ build problems
Next
From: Bruce Momjian
Date:
Subject: Re: libpq++ build problems