Subject: Doc error re: "not null" "not valid"

From: "Pete O'Such" <[email-masked]>
Date: Thu, 18 Jun 2026 00:15:13 -0400

https://www.postgresql.org/docs/9.1/sql-altertable.html

The text for "ADD table_constraint" says that NOT VALID "is currently only
allowed for foreign key constraints." Testing with 18.4 shows that this is
incorrect. A brief example of it working for a NOT NULL constraint is
available here:
https://neon.com/postgresql/18/not-null-as-not-valid

It looks like this is correctly noted as working in the 18.0 release notes
( https://www.postgresql.org/docs/release/18.0/ ), but not in the main docs.

Thank you!

-Pete O'Such

---

From: "David G. Johnston" <[email-masked]>
Date: Wed, 17 Jun 2026 21:26:31 -0700

On Wednesday, June 17, 2026, Pete O'Such <[email-masked]> wrote:

> allowed for foreign key constraints."
>
>
You are commenting on version 9.1 documentation but testing version 18.
The 18 docs mention not-null constraints.

David J.

---

From: "Pete O'Such" <[email-masked]>
Date: Thu, 18 Jun 2026 00:45:46 -0400

> The 18 docs mention not-null constraints.

That's totally right. Thanks for setting me straight.

Pete

On Thu, Jun 18, 2026 at 12:26 AM David G. Johnston <
[email-masked]> wrote:

>> The text for "ADD table_constraint" says that NOT VALID "is currently
>> only allowed for foreign key constraints."
>>
>>