Created
March 14, 2017 14:49
-
-
Save maxim-s/776d63b3733cc0807acec20e560fb555 to your computer and use it in GitHub Desktop.
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
SELECT r.specific_name AS id, | |
r.routine_schema AS Schema, | |
r.routine_name AS Name, | |
r.data_type AS ReturnType, | |
r.routine_type AS RoutineType, | |
(SELECT STRING_AGG(x.param, E'\n') | |
FROM (SELECT p.parameter_mode || ';' || p.parameter_name || ';' || p.data_type AS param | |
FROM information_schema.parameters p | |
WHERE p.specific_name = r.specific_name | |
ORDER BY p.ordinal_position) x) AS InputArgs | |
FROM information_schema.routines r | |
WHERE r.routine_schema NOT IN ('pg_catalog', 'information_schema') | |
AND r.routine_name NOT IN (SELECT routine_name | |
FROM information_schema.routines | |
GROUP BY routine_name | |
HAVING COUNT(routine_name) > 1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment