diff options
author | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2012-07-24 15:49:54 -0400 |
---|---|---|
committer | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2012-07-24 16:01:32 -0400 |
commit | d7b47e515530520da9564b05991bd8a8c6f52b06 (patch) | |
tree | feeada7a3a64415b1e1fe1bc50e008fe5a6329e1 /doc/src/sgml/ref/alter_table.sgml | |
parent | d61d9aa7501f31f99ee089f8b014161254eafa89 (diff) |
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.
Diffstat (limited to 'doc/src/sgml/ref/alter_table.sgml')
-rw-r--r-- | doc/src/sgml/ref/alter_table.sgml | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/doc/src/sgml/ref/alter_table.sgml b/doc/src/sgml/ref/alter_table.sgml index 3f61d7d45fe..b7648142eea 100644 --- a/doc/src/sgml/ref/alter_table.sgml +++ b/doc/src/sgml/ref/alter_table.sgml @@ -495,7 +495,7 @@ ALTER TABLE [ IF EXISTS ] <replaceable class="PARAMETER">name</replaceable> <para> There must also be matching child-table constraints for all <literal>CHECK</literal> constraints of the parent, except those - marked non-inheritable (that is, created with <literal>ALTER TABLE ONLY</literal>) + marked non-inheritable (that is, created with <literal>ALTER TABLE ... ADD CONSTRAINT ... NO INHERIT</literal>) in the parent, which are ignored; all child-table constraints matched must not be marked non-inheritable. Currently @@ -1013,7 +1013,7 @@ ALTER TABLE distributors ADD CONSTRAINT zipchk CHECK (char_length(zipcode) = 5); <para> To add a check constraint only to a table and not to its children: <programlisting> -ALTER TABLE distributors ADD CONSTRAINT zipchk CHECK NO INHERIT (char_length(zipcode) = 5); +ALTER TABLE distributors ADD CONSTRAINT zipchk CHECK (char_length(zipcode) = 5) NO INHERIT; </programlisting> (The check constraint will not be inherited by future children, either.) </para> |