mirror of
https://github.com/postgres/postgres.git
synced 2025-10-16 17:07:43 +03:00
Change syntax of new CHECK NO INHERIT constraints
The initially implemented syntax, "CHECK NO INHERIT (expr)" was not deemed very good, so switch to "CHECK (expr) NO INHERIT" instead. This way it looks similar to SQL-standards compliant constraint attribute. Backport to 9.2 where the new syntax and feature was introduced. Per discussion.
This commit is contained in:
@@ -921,8 +921,14 @@ DefineDomain(CreateDomainStmt *stmt)
|
||||
|
||||
/*
|
||||
* Check constraints are handled after domain creation, as
|
||||
* they require the Oid of the domain
|
||||
* they require the Oid of the domain; at this point we can
|
||||
* only check that they're not marked NO INHERIT, because
|
||||
* that would be bogus.
|
||||
*/
|
||||
if (constr->is_no_inherit)
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
|
||||
errmsg("CHECK constraints for domains cannot be marked NO INHERIT")));
|
||||
break;
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user