The CREATE TABLE documentation groups NOT NULL under table_constraint.

Started by PG Bug reporting form2 days ago2 messagesdocs
Jump to latest
#1PG Bug reporting form
noreply@postgresql.org

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/18/ddl.html
Description:

Unlike UNIQUE or CHECK, NOT NULL cannot be used standalone at the table
level in a standard way
Example: CREATE TABLE t (a int, NOT NULL a); fails.
It only works as an "out-of-line" constraint in very specific inheritance
scenarios.

#2David G. Johnston
david.g.johnston@gmail.com
In reply to: PG Bug reporting form (#1)
Re: The CREATE TABLE documentation groups NOT NULL under table_constraint.

On Friday, April 3, 2026, PG Doc comments form <noreply@postgresql.org>
wrote:

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/18/ddl.html
Description:

Unlike UNIQUE or CHECK, NOT NULL cannot be used standalone at the table
level in a standard way
Example: CREATE TABLE t (a int, NOT NULL a); fails.
It only works as an "out-of-line" constraint in very specific inheritance
scenarios.

As of v18 it works. v17 and earlier do not document it.

David J.