Hello,

Ok, I corrected the patch as suggested. I hope I did it right.

Have a nice day,

Lætitia

Le lun. 25 juin 2018 à 16:02, Lætitia Avrot <laetitia.av...@gmail.com> a
écrit :

> Thanks!
> I'll correct the patch ASAP including your modifications.
>
> Le sam. 23 juin 2018 à 19:15, Fabien COELHO <coe...@cri.ensmp.fr> a
> écrit :
>
>>
>> Hello lætitia,
>>
>> My 0.02 € to try to simplify the suggested documentation.
>>
>> > Check constraint were not
>>
>> are not
>>
>> > designed to enforce business rules across tables.
>>
>> > Avoid using check constraints with function accessing to other tables
>>
>> accessing other tables (no "to")
>>
>> > and prefer triggers instead (please refer to <xref linkend="triggers"/>
>> > for more information about triggers).
>>
>> ... and use <xref linkend="triggers"/> instead.
>>
>> > PostgreSQL won't prevent you from doing so,
>>
>> Although PostgreSQL ... so,
>>
>> > but be aware you might encounter difficulties to restore dumps
>> > (generated with pg_dump or pg_dumpall) if you do.
>>
>> beware that dumps generated by <application>pg_*<...> or <...> may be
>> hard
>> to restore because of such checks, as the underlying dependencies are not
>> taken into account.
>>
>> --
>> Fabien.
>
>
>
> --
> *Think! Do you really need to print this email ? *
> *There is no Planet B.*
>


-- 
*Think! Do you really need to print this email ? *
*There is no Planet B.*
diff --git a/doc/src/sgml/ddl.sgml b/doc/src/sgml/ddl.sgml
index 50dc25f..c677dc4 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>
+     Check constraint are not designed to enforce business rules across tables.
+     Avoid using check constraints with function accessing other tables and
+     use <xref linkend="triggers"/> instead. Although PostgreSQL won't prevent you
+     from doing so, but beware that dumps generated by <application>pg_dump</application>
+     or <application>pg_dumpall</application> may be hard
+     to restore because of such checks, as the underlying dependencies are not
+     taken into account.
+    </para>
+   </note>
   </sect2>
 
   <sect2>

Reply via email to