Last active
July 4, 2024 09:32
-
-
Save nielsbom/3e1308f89b811a9e13dac58a77723014 to your computer and use it in GitHub Desktop.
Generate string of function names installed by PostgreSQL extensions, for filtering *out* in DBeaver UI
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Filters function names from extensions: postgis, btree_gist, fuzzystrmatch | |
with function_names (name) as (SELECT | |
p.proname as function_name | |
FROM | |
pg_catalog.pg_extension AS e | |
INNER JOIN pg_catalog.pg_depend AS d ON (d.refobjid = e.oid) | |
INNER JOIN pg_catalog.pg_proc AS p ON (p.oid = d.objid) | |
INNER JOIN pg_catalog.pg_namespace AS ne ON (ne.oid = e.extnamespace) | |
INNER JOIN pg_catalog.pg_namespace AS np ON (np.oid = p.pronamespace) | |
WHERE | |
d.deptype = 'e' | |
AND | |
( | |
e.extname = 'postgis' | |
OR | |
e.extname = 'btree_gist' | |
OR | |
e.extname = 'fuzzystrmatch' | |
) | |
ORDER BY | |
function_name | |
) | |
select array_to_string( | |
array(select * from function_names), | |
'|' | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment