Project

General

Profile

« Previous | Next » 

Revision 12385

schemas/util.sql: show_views_like(): take a schema regexp like util.show_relations_like(), to allow matching views in all schemas

View differences:

trunk/schemas/util.sql
2983 2983
-- Name: show_views_like(text, text); Type: FUNCTION; Schema: util; Owner: -
2984 2984
--
2985 2985

  
2986
CREATE FUNCTION show_views_like(name_regexp text, schema text) RETURNS SETOF regclass
2986
CREATE FUNCTION show_views_like(name_regexp text, schema_regexp text DEFAULT ''::text) RETURNS SETOF regclass
2987 2987
    LANGUAGE sql STABLE
2988 2988
    AS $_$
2989
SELECT view_
2990
FROM util.show_relations_like($1, types := ARRAY['v']) view_
2991
WHERE util.schema(view_) = $2
2989
SELECT * FROM util.show_relations_like($1, $2, ARRAY['v'])
2992 2990
$_$;
2993 2991

  
2994 2992

  
trunk/schemas/vegbien.sql
2300 2300
CREATE FUNCTION validation_views(schema text) RETURNS SETOF regclass
2301 2301
    LANGUAGE sql STABLE
2302 2302
    AS $_$
2303
SELECT * FROM util.show_views_like('^_[[:alpha:]]+_\d+_', $1)
2303
SELECT *
2304
FROM util.show_views_like('^_[[:alpha:]]+_\d+_', util.str_equality_regexp($1))
2304 2305
$_$;
2305 2306

  
2306 2307

  

Also available in: Unified diff