Project

General

Profile

« Previous | Next » 

Revision 12415

schemas/vegbien.sql: added rm_query_group(), which removes all validations queries with a particular group prefix

View differences:

vegbien.sql
2275 2275

  
2276 2276

  
2277 2277
--
2278
-- Name: rm_query_group(text, anyelement); Type: FUNCTION; Schema: public_validations; Owner: -
2279
--
2280

  
2281
CREATE FUNCTION rm_query_group(group_ text, schema_anchor anyelement DEFAULT NULL::schema_anchor) RETURNS void
2282
    LANGUAGE sql
2283
    AS $_$
2284
SELECT util.drop_relations_like('^_'||util.regexp_quote($1)||'_', $2,
2285
force := true/*needed because some query-view-relations depend on others*/)
2286
$_$;
2287

  
2288

  
2289
--
2290
-- Name: FUNCTION rm_query_group(group_ text, schema_anchor anyelement); Type: COMMENT; Schema: public_validations; Owner: -
2291
--
2292

  
2293
COMMENT ON FUNCTION rm_query_group(group_ text, schema_anchor anyelement) IS '
2294
removes all validations queries with a particular group prefix.
2295
note that this will cascadingly drop all input/ouptut tables for those queries''
2296
results, as well (as these inherit from type tables in this schema).
2297

  
2298
usage:
2299
SELECT public_validations.rm_query_group(''plots'');
2300

  
2301
idempotent
2302

  
2303
schema_anchor: identifies which schema to use. should be left as the default value.
2304
';
2305

  
2306

  
2307
--
2278 2308
-- Name: rm_query_view(regclass, anyelement); Type: FUNCTION; Schema: public_validations; Owner: -
2279 2309
--
2280 2310

  

Also available in: Unified diff