I would like to be able to get a table of function names and function owner names.
Currently, this query returns a list of functions for a given schema:
SELECT proname
FROM pg_catalog.pg_namespace n
JOIN pg_catalog.pg_proc p
ON pronamespace = n.oid
WHERE nspname = '<%= schema_name %>';
I can see there is a proowner column which returns the ID of the role.
https://www.postgresql.org/docs/10/catalog-pg-proc.html
What I would like is something that returns the name of the owner, I just don't know enough SQL yet to figure out how to JOIN the tables etc..
|function_name|function_owner|
______________________________
|func1 |func1_owner |
|func2 |func2_owner |
If someone could explain how to do this I would be very grateful!
Thanks