Revision 13142
Added by Aaron Marcuse-Kubitza almost 11 years ago
vegbien.sql | ||
---|---|---|
4511 | 4511 |
-- Name: rm_output_queries(text, integer, anyelement); Type: FUNCTION; Schema: public_validations; Owner: - |
4512 | 4512 |
-- |
4513 | 4513 |
|
4514 |
CREATE FUNCTION rm_output_queries(prefix text DEFAULT NULL::text, max_prefix_len integer DEFAULT query_view_relation_max_prefix_len(), schema_anchor anyelement DEFAULT NULL::schema_anchor) RETURNS void
|
|
4514 |
CREATE FUNCTION rm_output_queries(name text DEFAULT NULL::text, max_prefix_len integer DEFAULT query_view_relation_max_prefix_len(), schema_anchor anyelement DEFAULT NULL::schema_anchor) RETURNS void
|
|
4515 | 4515 |
LANGUAGE sql |
4516 | 4516 |
AS $_$ |
4517 |
SELECT util.drop_relations_like('^(?:\w*~type\.)?'|| |
|
4518 |
COALESCE(util.regexp_quote(util.truncated_prefixed_name_regexp($1, $2)), |
|
4519 |
'_[[:alpha:]]+_'), |
|
4517 |
SELECT util.drop_relations_like( |
|
4518 |
COALESCE(util.truncated_prefixed_name_regexp($1, $2), '_[[:alpha:]]+_'), |
|
4520 | 4519 |
$3, force := true/*needed because some query-view-relations depend on others*/) |
4521 | 4520 |
$_$; |
4522 | 4521 |
|
4523 | 4522 |
|
4524 | 4523 |
-- |
4525 |
-- Name: FUNCTION rm_output_queries(prefix text, max_prefix_len integer, schema_anchor anyelement); Type: COMMENT; Schema: public_validations; Owner: -
|
|
4524 |
-- Name: FUNCTION rm_output_queries(name text, max_prefix_len integer, schema_anchor anyelement); Type: COMMENT; Schema: public_validations; Owner: -
|
|
4526 | 4525 |
-- |
4527 | 4526 |
|
4528 |
COMMENT ON FUNCTION rm_output_queries(prefix text, max_prefix_len integer, schema_anchor anyelement) IS '
|
|
4527 |
COMMENT ON FUNCTION rm_output_queries(name text, max_prefix_len integer, schema_anchor anyelement) IS '
|
|
4529 | 4528 |
removes validations *output* queries (in this function''s schema) |
4530 | 4529 |
|
4531 | 4530 |
note that this will cascadingly drop all result tables for those queries as well |
... | ... | |
4536 | 4535 |
to remove all output queries: |
4537 | 4536 |
SELECT public_validations.rm_output_queries(); |
4538 | 4537 |
|
4539 |
to remove output queries with a particular group prefix: |
|
4540 |
SELECT public_validations.rm_output_queries(''_group_''); |
|
4541 |
|
|
4542 | 4538 |
to remove a particular output query: |
4543 | 4539 |
SELECT public_validations.rm_output_queries(''_view_name''); |
4544 | 4540 |
|
Also available in: Unified diff
bugfix: schemas/vegbien.sql: rm_output_queries(): need to account for the fact that util.truncated_prefixed_name_regexp() returns a whole-string regexp. this drops support for removing output queries with a particular group prefix, which we no longer use.