Mark CHECK constraints declared NOT VALID valid if created with table.
Robert Haas <rhaas@postgresql.org>
Mark CHECK constraints declared NOT VALID valid if created with table. FOREIGN KEY constraints have behaved this way for a long time, but for some reason the behavior of CHECK constraints has been inconsistent up until now. Amit Langote and Amul Sul, with assorted tweaks by me.
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/catalog/heap.c | modified | +1 −1 |
| src/backend/parser/gram.y | modified | +2 −0 |
| src/backend/parser/parse_utilcmd.c | modified | +43 −2 |
| src/test/regress/expected/alter_table.out | modified | +10 −1 |
| src/test/regress/sql/alter_table.sql | modified | +4 −1 |