Revision 12325
Added by Aaron Marcuse-Kubitza almost 11 years ago
trunk/schemas/util.sql | ||
---|---|---|
2692 | 2692 |
|
2693 | 2693 |
|
2694 | 2694 |
-- |
2695 |
-- Name: show_relations_like(text, text, character[]); Type: FUNCTION; Schema: util; Owner: - |
|
2696 |
-- |
|
2697 |
|
|
2698 |
CREATE FUNCTION show_relations_like(name_regexp text, schema_regexp text DEFAULT ''::text, types character[] DEFAULT ARRAY['r'::text, 'v'::text]) RETURNS SETOF regclass |
|
2699 |
LANGUAGE sql STABLE |
|
2700 |
AS $_$ |
|
2701 |
SELECT oid FROM pg_class |
|
2702 |
WHERE relkind = ANY($3) AND relname ~ $1 |
|
2703 |
AND util.schema_matches(util.schema(relnamespace), $2) |
|
2704 |
ORDER BY relname |
|
2705 |
$_$; |
|
2706 |
|
|
2707 |
|
|
2708 |
-- |
|
2695 | 2709 |
-- Name: show_views_like(text, text); Type: FUNCTION; Schema: util; Owner: - |
2696 | 2710 |
-- |
2697 | 2711 |
|
Also available in: Unified diff
schemas/util.sql: added show_relations_like()