Re: ALTER TABLE Column NOT NULL? - Mailing list pgsql-general

From Tom Lane
Subject Re: ALTER TABLE Column NOT NULL?
Date
Msg-id 1073.1011988355@sss.pgh.pa.us
Whole thread Raw
In response to ALTER TABLE Column NOT NULL?  ("Gregory Wood" <gregw@com-stock.com>)
List pgsql-general
"Gregory Wood" <gregw@com-stock.com> writes:
> Is there any way to add a NOT NULL constraint to a new field in a
> table,

After you fill the field with some non-nulls, you could add a CHECK NOT
NULL constraint, or if you prefer efficiency over cleanliness, tweak the
attnotnull field of the field's pg_attribute row.

            regards, tom lane

pgsql-general by date:

Previous
From: "Gregory Wood"
Date:
Subject: ALTER TABLE Column NOT NULL?
Next
From: Alvaro Herrera
Date:
Subject: Re: ALTER TABLE Column NOT NULL?