Project

General

Profile

« Previous | Next » 

Revision 14333

schemas/util.sql: derived_col_constraint_initially_enabled(): clarified that this is always based on whether the existing constraint is enabled

View differences:

trunk/schemas/util.sql
1858 1858
    LANGUAGE sql STABLE
1859 1859
    AS $$
1860 1860
SELECT
1861
	-- expr not changing and constraint already enabled
1862
		def.expr IS NOT DISTINCT FROM util.derived_col_expr(def.col)
1863
	AND util.check_constraint_enabled(def.col::util.table_item)
1861
	-- existing constraint enabled, and no expr change that would disable it
1862
		util.check_constraint_enabled(def.col::util.table_item)
1863
	AND def.expr IS NOT DISTINCT FROM util.derived_col_expr(def.col)
1864 1864
OR
1865 1865
	NOT util.table_has_data((def).col.table_) -- empty, so would always pass
1866 1866
$$;

Also available in: Unified diff