Revision 14147
Added by Aaron Marcuse-Kubitza over 10 years ago
util.sql | ||
---|---|---|
1477 | 1477 |
|
1478 | 1478 |
|
1479 | 1479 |
-- |
1480 |
-- Name: derived_col_expr_from_check_constraint(check_constraint_def); Type: FUNCTION; Schema: util; Owner: - |
|
1481 |
-- |
|
1482 |
|
|
1483 |
CREATE FUNCTION derived_col_expr_from_check_constraint(check_constraint_def check_constraint_def) RETURNS text |
|
1484 |
LANGUAGE sql IMMUTABLE |
|
1485 |
AS $_$ |
|
1486 |
SELECT util.extract_str($$(NOT ($$||quote_ident( |
|
1487 |
(check_constraint_def).constraint_.name)||$$ IS DISTINCT FROM $$, |
|
1488 |
$$))$$, check_constraint_def.expr) |
|
1489 |
$_$; |
|
1490 |
|
|
1491 |
|
|
1492 |
-- |
|
1480 | 1493 |
-- Name: derived_cols(regclass, regclass); Type: FUNCTION; Schema: util; Owner: - |
1481 | 1494 |
-- |
1482 | 1495 |
|
Also available in: Unified diff
schemas/util.sql: added derived_col_expr_from_check_constraint()