check_constraint_accross_table_note_v1.patch
text/x-patch
Filename: check_constraint_accross_table_note_v1.patch
Type: text/x-patch
Part: 0
Message:
Constraint documentation
Patch
Format: unified
Series: patch v1
| File | + | − |
|---|---|---|
| doc/src/sgml/ddl.sgml | 11 | 0 |
diff --git a/doc/src/sgml/ddl.sgml b/doc/src/sgml/ddl.sgml
index 2cd0b8a..dfe00a5 100644
--- a/doc/src/sgml/ddl.sgml
+++ b/doc/src/sgml/ddl.sgml
@@ -403,6 +403,17 @@ 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>
+ Check constraint were not designed to enforce business rules across tables.
+ Avoid using check constraints with function accessing to other tables and
+ prefer triggers instead (please refer to <xref linkend="triggers"/> for
+ more information about triggers). PostgreSQL won't prevent you
+ from doing so, but be aware you might encounter difficulties to restore
+ dumps (generated with pg_dump or pg_dumpall) if you do.
+ </para>
+ </note>
</sect2>
<sect2>