Revision 14189
Added by Aaron Marcuse-Kubitza over 10 years ago
trunk/schemas/util.sql | ||
---|---|---|
984 | 984 |
|
985 | 985 |
|
986 | 986 |
-- |
987 |
-- Name: check_constraint_enabled(check_constraint_def); Type: FUNCTION; Schema: util; Owner: - |
|
988 |
-- |
|
989 |
|
|
990 |
CREATE FUNCTION check_constraint_enabled(constraint_def check_constraint_def) RETURNS boolean |
|
991 |
LANGUAGE sql STABLE |
|
992 |
AS $_$ |
|
993 |
SELECT NOT /*disabled*/util.starts_with($$true OR $$, constraint_def.expr) |
|
994 |
$_$; |
|
995 |
|
|
996 |
|
|
997 |
-- |
|
998 |
-- Name: FUNCTION check_constraint_enabled(constraint_def check_constraint_def); Type: COMMENT; Schema: util; Owner: - |
|
999 |
-- |
|
1000 |
|
|
1001 |
COMMENT ON FUNCTION check_constraint_enabled(constraint_def check_constraint_def) IS ' |
|
1002 |
also accepts a util.table_item via implicit cast |
|
1003 |
|
|
1004 |
usage: |
|
1005 |
SELECT util.check_constraint_enabled((table, constraint_name)::util.table_item); |
|
1006 |
'; |
|
1007 |
|
|
1008 |
|
|
1009 |
-- |
|
987 | 1010 |
-- Name: check_constraint_expr_disable(text); Type: FUNCTION; Schema: util; Owner: - |
988 | 1011 |
-- |
989 | 1012 |
|
Also available in: Unified diff
schemas/util.sql: added check_constraint_enabled()