1
0
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:
Alvaro Herrera
2012-07-24 15:49:54 -04:00
parent d61d9aa750
commit d7b47e5155
12 changed files with 67 additions and 48 deletions

View File

@@ -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;
/*