IDENTITY columns are NOT NULL automatically

Erwin Brandstetter <[email protected]>
Newsgroups gmane.comp.db.postgresql.devel.documentation
Message-ID <CAGHENJ6db0U+7LjhWWov96aFW0exkOBRi2roKb06n2UsWM9VhQ@mail.gmail.com>
 An IDENTITY column is automatically NOT NULL - which is per SQL standard.
I think this should be documented in sql-createtable.html. The same is
currently documented for PRIMARY KEY constraints:

https://www.postgresql.org/docs/devel/sql-createtable.html

> PRIMARY KEY enforces the same data constraints as a combination of UNIQUE
and NOT NULL

I suggest to replace this paragraph:

<< This clause creates the column as an identity column. It will have an
implicit sequence attached to it and the column in new rows will
automatically have values from the sequence assigned to it.

With this:

>> This clause creates the column as an identity column - with an implicit
sequence attached to it that automatically supplies column values for new
rows. A NOT NULL constraint is applied automatically.

Regards
Erwin
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.