CDB-3743 Makes CDB_QueryTables to return only results for schemas associated to Relation-Names

This commit is contained in:
Raul Ochoa
2014-08-01 18:06:06 +02:00
parent a9005dc93c
commit 2637742c2e
2 changed files with 22 additions and 1 deletions

View File

@@ -39,7 +39,7 @@ BEGIN
inp AS (
SELECT
xpath('//x:Relation-Name/text()', exp, ARRAY[ARRAY['x', 'http://www.postgresql.org/2009/explain']]) as x,
xpath('//x:Schema/text()', exp, ARRAY[ARRAY['x', 'http://www.postgresql.org/2009/explain']]) as s
xpath('//x:Relation-Name/../x:Schema/text()', exp, ARRAY[ARRAY['x', 'http://www.postgresql.org/2009/explain']]) as s
)
SELECT unnest(x)::name as p, unnest(s)::name as sc from inp
LOOP