Skip to content

Commit

Permalink
fix for pg_temp function includes/excludes
Browse files Browse the repository at this point in the history
  • Loading branch information
bitner committed Oct 30, 2023
1 parent 5777e16 commit 0739603
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion tests/routes/test_collections.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ def test_collections_include_functions(app_includes_function):
assert response.status_code == 200
body = response.json()
ids = [x["id"] for x in body["collections"]]
assert ["pg_temp.hexagons", "pg_temp.squares"] == ids
assert ["pg_temp.hexagons"] == ids


def test_collections_empty(app_empty):
Expand Down
8 changes: 4 additions & 4 deletions tipg/sql/dbcatalog.sql
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,8 @@ CREATE OR REPLACE FUNCTION pg_temp.tipg_catalog(
AND relkind IN ('r','v', 'm', 'f', 'p')
AND has_table_privilege(c.oid, 'SELECT')
AND c.relname::text NOT IN ('spatial_ref_sys','geometry_columns','geography_columns')
AND (exclude_tables IS NULL OR concat(c.relnamespace::regnamespace::text,'.',c.relname::text) <> ALL (exclude_tables))
AND (tables IS NULL OR concat(c.relnamespace::regnamespace::text,'.',c.relname::text) = ANY (tables))
AND (exclude_tables IS NULL OR concat(pg_temp.nspname(relnamespace),'.',c.relname::text) <> ALL (exclude_tables))
AND (tables IS NULL OR concat(pg_temp.nspname(relnamespace),'.',c.relname::text) = ANY (tables))

UNION ALL

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

0 comments on commit 0739603

Please sign in to comment.