Project

General

Profile

« Previous | Next » 

Revision 14352

schemas/util.sql: check_constraint_disable(): documented that we can't use ADD CONSTRAINT NOT VALID for this because it does not disable the constraint completely, but instead causes new rows to be validated against it. the ADD CONSTRAINT NOT VALID behavior does not work for the derived columns use case of this function.

View differences:

trunk/schemas/util.sql
1023 1023
CREATE FUNCTION check_constraint_disable(constraint_def check_constraint_def) RETURNS void
1024 1024
    LANGUAGE sql
1025 1025
    AS $$
1026
/* can't use ADD CONSTRAINT NOT VALID for this because it does not disable the
1027
constraint completely, but instead causes new rows to be validated against it */
1026 1028
SELECT util.check_constraint_replace((constraint_def.constraint_,
1027 1029
util.check_constraint_expr_disable(constraint_def.expr)))
1028 1030
$$;

Also available in: Unified diff