Project

General

Profile

« Previous | Next » 

Revision 12545

schemas/vegbien.sql: rm_query_group(): support removing all validations as well as just those with a particular group prefix (and renamed to rm_output_queries())

View differences:

trunk/schemas/vegbien.my.sql
1015 1015

  
1016 1016

  
1017 1017
--
1018
-- Name: rm_query_group(varchar(255), anyelement); Type: FUNCTION; Schema: public_validations; Owner: -
1018
-- Name: rm_output_queries(varchar(255), anyelement); Type: FUNCTION; Schema: public_validations; Owner: -
1019 1019
--
1020 1020

  
1021 1021

  
1022 1022

  
1023 1023

  
1024 1024
--
1025
-- Name: FUNCTION rm_query_group(group_ varchar(255), schema_anchor anyelement); Type: COMMENT; Schema: public_validations; Owner: -
1025
-- Name: FUNCTION rm_output_queries(group_ varchar(255), schema_anchor anyelement); Type: COMMENT; Schema: public_validations; Owner: -
1026 1026
--
1027 1027

  
1028 1028

  
trunk/schemas/vegbien.sql
2343 2343

  
2344 2344

  
2345 2345
--
2346
-- Name: rm_query_group(text, anyelement); Type: FUNCTION; Schema: public_validations; Owner: -
2346
-- Name: rm_output_queries(text, anyelement); Type: FUNCTION; Schema: public_validations; Owner: -
2347 2347
--
2348 2348

  
2349
CREATE FUNCTION rm_query_group(group_ text, schema_anchor anyelement DEFAULT NULL::schema_anchor) RETURNS void
2349
CREATE FUNCTION rm_output_queries(group_ text DEFAULT NULL::text, schema_anchor anyelement DEFAULT NULL::schema_anchor) RETURNS void
2350 2350
    LANGUAGE sql
2351 2351
    AS $_$
2352
SELECT util.drop_relations_like('^(?:~type\.)?_'||util.regexp_quote($1)||'_',
2352
SELECT util.drop_relations_like('^(?:~type\.)?_'||
2353
COALESCE(util.regexp_quote($1), '[[:alpha:]]+') ||'_',
2353 2354
$2, force := true/*needed because some query-view-relations depend on others*/)
2354 2355
$_$;
2355 2356

  
2356 2357

  
2357 2358
--
2358
-- Name: FUNCTION rm_query_group(group_ text, schema_anchor anyelement); Type: COMMENT; Schema: public_validations; Owner: -
2359
-- Name: FUNCTION rm_output_queries(group_ text, schema_anchor anyelement); Type: COMMENT; Schema: public_validations; Owner: -
2359 2360
--
2360 2361

  
2361
COMMENT ON FUNCTION rm_query_group(group_ text, schema_anchor anyelement) IS '
2362
removes all validations *output* queries (in this function''s schema) that have
2363
a particular group prefix.
2362
COMMENT ON FUNCTION rm_output_queries(group_ text, schema_anchor anyelement) IS '
2363
removes all validations *output* queries (in this function''s schema), or just
2364
those that have a particular group prefix.
2364 2365

  
2365 2366
note that this will cascadingly drop all result tables for those queries as well
2366 2367
(as these inherit from type tables in this function''s schema).

Also available in: Unified diff