Revision 14156
Added by Aaron Marcuse-Kubitza over 10 years ago
trunk/schemas/util.sql | ||
---|---|---|
921 | 921 |
|
922 | 922 |
|
923 | 923 |
-- |
924 |
-- Name: check_constraint_replace(check_constraint_def); Type: FUNCTION; Schema: util; Owner: - |
|
925 |
-- |
|
926 |
|
|
927 |
CREATE FUNCTION check_constraint_replace(constraint_def check_constraint_def) RETURNS void |
|
928 |
LANGUAGE sql |
|
929 |
AS $_$ |
|
930 |
SELECT util.check_constraint_drop(constraint_def.constraint_); |
|
931 |
SELECT util.eval($$ALTER TABLE $$||(constraint_def).constraint_.table_ |
|
932 |
||$$ ADD CONSTRAINT $$||quote_ident((constraint_def).constraint_.name) |
|
933 |
||$$ CHECK ($$||(constraint_def).expr||$$)$$); |
|
934 |
$_$; |
|
935 |
|
|
936 |
|
|
937 |
-- |
|
924 | 938 |
-- Name: cluster(regclass, regclass); Type: FUNCTION; Schema: util; Owner: - |
925 | 939 |
-- |
926 | 940 |
|
Also available in: Unified diff
schemas/util.sql: added check_constraint_replace()