IDENTITY columns are NOT NULL automatically - Mailing list pgsql-docs

From Erwin Brandstetter
Subject IDENTITY columns are NOT NULL automatically
Date
Msg-id CAGHENJ6db0U+7LjhWWov96aFW0exkOBRi2roKb06n2UsWM9VhQ@mail.gmail.com
Whole thread Raw
List pgsql-docs
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:


> 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

pgsql-docs by date:

Previous
From: "Jonathan S. Katz"
Date:
Subject: Re: Release note trimming: another modest proposal
Next
From: Tom Lane
Date:
Subject: Re: Release note trimming: another modest proposal