Skip to content

Commit 0739603

Browse files
committed
fix for pg_temp function includes/excludes
1 parent 5777e16 commit 0739603

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

tests/routes/test_collections.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ def test_collections_include_functions(app_includes_function):
272272
assert response.status_code == 200
273273
body = response.json()
274274
ids = [x["id"] for x in body["collections"]]
275-
assert ["pg_temp.hexagons", "pg_temp.squares"] == ids
275+
assert ["pg_temp.hexagons"] == ids
276276

277277

278278
def test_collections_empty(app_empty):

tipg/sql/dbcatalog.sql

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -246,8 +246,8 @@ CREATE OR REPLACE FUNCTION pg_temp.tipg_catalog(
246246
AND relkind IN ('r','v', 'm', 'f', 'p')
247247
AND has_table_privilege(c.oid, 'SELECT')
248248
AND c.relname::text NOT IN ('spatial_ref_sys','geometry_columns','geography_columns')
249-
AND (exclude_tables IS NULL OR concat(c.relnamespace::regnamespace::text,'.',c.relname::text) <> ALL (exclude_tables))
250-
AND (tables IS NULL OR concat(c.relnamespace::regnamespace::text,'.',c.relname::text) = ANY (tables))
249+
AND (exclude_tables IS NULL OR concat(pg_temp.nspname(relnamespace),'.',c.relname::text) <> ALL (exclude_tables))
250+
AND (tables IS NULL OR concat(pg_temp.nspname(relnamespace),'.',c.relname::text) = ANY (tables))
251251

252252
UNION ALL
253253

@@ -263,8 +263,8 @@ CREATE OR REPLACE FUNCTION pg_temp.tipg_catalog(
263263
AND '' != ANY(proargnames)
264264
AND has_function_privilege(oid, 'execute')
265265
AND provariadic=0
266-
AND (exclude_functions IS NULL OR concat(p.pronamespace::regnamespace::text,'.',proname::text) <> ALL (exclude_functions))
267-
AND (functions IS NULL OR concat(p.pronamespace::regnamespace::text,'.',proname::text) = ANY (functions))
266+
AND (exclude_functions IS NULL OR concat(pg_temp.nspname(pronamespace),'.', proname::text) <> ALL (exclude_functions))
267+
AND (functions IS NULL OR concat(pg_temp.nspname(pronamespace),'.', proname::text) = ANY (functions))
268268
AND p.proname::text NOT ILIKE 'tipg_%'
269269
)
270270
SELECT meta FROM a

0 commit comments

Comments
 (0)