0

I have a PostgreSQL database with 37 schemas and > 500 functions. I'm trying to locate a specific function but am not seeing it when I manually browse the database tree in pgAdmin.

Is there a command in PostgreSQL to locate the schema that a specific function is in?

Thanks.

3
  • 1
    Maybe querying information_schema.routines might help? Commented Jul 9, 2013 at 16:44
  • 1
    Either query the catalogs, or use pg_dump --schema-only <dbname> and grep/edit the output. Commented Jul 9, 2013 at 16:46
  • 1
    \df function_name from inside psql is your friend. Commented Jul 9, 2013 at 16:48

1 Answer 1

2

You can use information_schema.routines to do this:

SELECT specific_schema,  specific_catalog, routine_schema, routine_catalog 
FROM  information_schema.routines
WHERE routine_name = 'X' AND routine_type = 'FUNCTION';
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.