check_constraint_accross_table_note_v4.patch
text/x-patch
Filename: check_constraint_accross_table_note_v4.patch
Type: text/x-patch
Part: 0
Message:
Re: Constraint documentation
Patch
Format: unified
Series: patch v4
| File | + | − |
|---|---|---|
| doc/src/sgml/ddl.sgml | 12 | 0 |
diff --git a/doc/src/sgml/ddl.sgml b/doc/src/sgml/ddl.sgml
index b5ed1b7939..f57f6e716d 100644
--- a/doc/src/sgml/ddl.sgml
+++ b/doc/src/sgml/ddl.sgml
@@ -403,6 +403,18 @@ CREATE TABLE products (
ensure that a column does not contain null values, the not-null
constraint described in the next section can be used.
</para>
+
+ <note>
+ <para>
+ Postgres does not currently support CHECK constraints containing queries,
+ therefore we recommend to avoid them. By using them, you may expect
+ troubles, especially to restore dumps.
+ CHECK constraints are currently meant to be used as row constraints only.
+ Use - if possible - UNIQUE or EXCLUDE constraints for constraints that
+ involve many or all rows of a table, and FOREIGN KEY constraints for cross
+ table constraints.
+ </para>
+ </note>
</sect2>
<sect2>