mirror of
https://github.com/postgres/postgres.git
synced 2025-06-14 18:42:34 +03:00
Recast "ONLY" column CHECK constraints as NO INHERIT
The original syntax wasn't universally loved, and it didn't allow its
usage in CREATE TABLE, only ALTER TABLE. It now works everywhere, and
it also allows using ALTER TABLE ONLY to add an uninherited CHECK
constraint, per discussion.
The pg_constraint column has accordingly been renamed connoinherit.
This commit partly reverts some of the changes in
61d81bd28d
, particularly some pg_dump and
psql bits, because now pg_get_constraintdef includes the necessary NO
INHERIT within the constraint definition.
Author: Nikhil Sontakke
Some tweaks by me
This commit is contained in:
2
src/backend/utils/cache/relcache.c
vendored
2
src/backend/utils/cache/relcache.c
vendored
@ -3262,7 +3262,7 @@ CheckConstraintFetch(Relation relation)
|
||||
RelationGetRelationName(relation));
|
||||
|
||||
check[found].ccvalid = conform->convalidated;
|
||||
check[found].cconly = conform->conisonly;
|
||||
check[found].ccnoinherit = conform->connoinherit;
|
||||
check[found].ccname = MemoryContextStrdup(CacheMemoryContext,
|
||||
NameStr(conform->conname));
|
||||
|
||||
|
Reference in New Issue
Block a user