Skip to content
Advertisement

Postgres Function exists in a particular schema

I have postgres DB which has multiple schemas, is there a way (query) which I can run to figure out if a function exists in a specific schema or in other words print a list of schema names under which a given function exists.

Advertisement

Answer

You can adapt following query:

select routine_name, routine_schema 
from information_schema.routines 
where routine_name='myfunction' 
and routine_type='FUNCTION';
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement