Revision 14207
Added by Aaron Marcuse-Kubitza over 10 years ago
trunk/schemas/util.sql | ||
---|---|---|
1054 | 1054 |
-- Name: check_constraint_replace(check_constraint_def); Type: FUNCTION; Schema: util; Owner: - |
1055 | 1055 |
-- |
1056 | 1056 |
|
1057 |
CREATE FUNCTION check_constraint_replace(constraint_def check_constraint_def) RETURNS void
|
|
1057 |
CREATE FUNCTION check_constraint_replace(def check_constraint_def) RETURNS void |
|
1058 | 1058 |
LANGUAGE sql |
1059 | 1059 |
AS $_$ |
1060 |
SELECT util.check_constraint_drop(constraint_def.constraint_);
|
|
1061 |
SELECT util.eval($$ALTER TABLE $$||(constraint_def).constraint_.table_
|
|
1062 |
||$$ ADD CONSTRAINT $$||quote_ident((constraint_def).constraint_.name)
|
|
1063 |
||$$ CHECK ($$||(constraint_def).expr||$$)$$);
|
|
1060 |
SELECT util.check_constraint_drop(def.constraint_); |
|
1061 |
SELECT util.eval($$ALTER TABLE $$||(def).constraint_.table_ |
|
1062 |
||$$ ADD CONSTRAINT $$||quote_ident((def).constraint_.name) |
|
1063 |
||$$ CHECK ($$||def.expr||$$)$$);
|
|
1064 | 1064 |
$_$; |
1065 | 1065 |
|
1066 | 1066 |
|
Also available in: Unified diff
schemas/util.sql: check_constraint_replace(): shortened param to `def` for readability