Revision 13380
Added by Aaron Marcuse-Kubitza over 10 years ago
trunk/schemas/public_.sql | ||
---|---|---|
4292 | 4292 |
-- |
4293 | 4293 |
|
4294 | 4294 |
CREATE FUNCTION query_relations(query_view regclass, max_prefix_len integer DEFAULT query_view_relation_max_prefix_len(), schema_anchor anyelement DEFAULT NULL::schema_anchor) RETURNS SETOF regclass |
4295 |
LANGUAGE sql STABLE |
|
4295 |
LANGUAGE plpgsql |
|
4296 |
SET search_path TO pg_temp |
|
4296 | 4297 |
AS $_$ |
4297 |
SELECT * FROM util.show_relations_like( |
|
4298 |
util.truncated_prefixed_name_regexp(util.name($1), $2), |
|
4299 |
(CASE WHEN util.schema($1) = util.schema($3) -- is in public_validations? |
|
4300 |
THEN '' -- output query, so remove in *all* schemas |
|
4301 |
ELSE util.schema_regexp($1) --input query, so remove only in datasource's schema |
|
4302 |
END) |
|
4303 |
) |
|
4298 |
BEGIN |
|
4299 |
PERFORM util.use_schema(schema_anchor); |
|
4300 |
|
|
4301 |
RETURN QUERY |
|
4302 |
SELECT * FROM util.show_relations_like( |
|
4303 |
truncated_prefixed_name_regexp(util.name($1)), |
|
4304 |
(CASE WHEN util.schema($1) = util.schema($3) -- is in public_validations? |
|
4305 |
THEN '' -- output query, so remove in *all* schemas |
|
4306 |
ELSE util.schema_regexp($1) -- input query, so remove only in datasource's schema |
|
4307 |
END) |
|
4308 |
) |
|
4309 |
; |
|
4310 |
END; |
|
4304 | 4311 |
$_$; |
4305 | 4312 |
|
4306 | 4313 |
|
trunk/schemas/vegbien.sql | ||
---|---|---|
4292 | 4292 |
-- |
4293 | 4293 |
|
4294 | 4294 |
CREATE FUNCTION query_relations(query_view regclass, max_prefix_len integer DEFAULT query_view_relation_max_prefix_len(), schema_anchor anyelement DEFAULT NULL::schema_anchor) RETURNS SETOF regclass |
4295 |
LANGUAGE sql STABLE |
|
4295 |
LANGUAGE plpgsql |
|
4296 |
SET search_path TO pg_temp |
|
4296 | 4297 |
AS $_$ |
4297 |
SELECT * FROM util.show_relations_like( |
|
4298 |
util.truncated_prefixed_name_regexp(util.name($1), $2), |
|
4299 |
(CASE WHEN util.schema($1) = util.schema($3) -- is in public_validations? |
|
4300 |
THEN '' -- output query, so remove in *all* schemas |
|
4301 |
ELSE util.schema_regexp($1) --input query, so remove only in datasource's schema |
|
4302 |
END) |
|
4303 |
) |
|
4298 |
BEGIN |
|
4299 |
PERFORM util.use_schema(schema_anchor); |
|
4300 |
|
|
4301 |
RETURN QUERY |
|
4302 |
SELECT * FROM util.show_relations_like( |
|
4303 |
truncated_prefixed_name_regexp(util.name($1)), |
|
4304 |
(CASE WHEN util.schema($1) = util.schema($3) -- is in public_validations? |
|
4305 |
THEN '' -- output query, so remove in *all* schemas |
|
4306 |
ELSE util.schema_regexp($1) -- input query, so remove only in datasource's schema |
|
4307 |
END) |
|
4308 |
) |
|
4309 |
; |
|
4310 |
END; |
|
4304 | 4311 |
$_$; |
4305 | 4312 |
|
4306 | 4313 |
|
Also available in: Unified diff
schemas/public_.sql: query_relations(): use new public_validations.truncated_prefixed_name_regexp(), which does not require passing in a max_prefix_len