What SQL Script in Postgres to return the Functions of a Schema? [closed]

2

What SQL Script in Postgres to return the Functions of a Schema with its input parameters?

    
asked by anonymous 31.12.2018 / 15:11

1 answer

3
SELECT 
    inf.routine_name, 
    par.data_type, 
    par.ordinal_position,
    par.parameter_name,
    par.parameter_mode
FROM 
    information_schema.routines inf
LEFT OUTER JOIN
     information_schema.parameters par ON inf.specific_name = par.specific_name
WHERE 
    inf.specific_schema='name_schema' and
    par.parameter_mode = 'IN'
ORDER BY 
    inf.routine_name, 
    par.ordinal_position;

or Displays Functions Not Linked to Triggers

SELECT 
    format('%I.%I(%s)', 
    ns.nspname, 
    p.proname, 
    pg_get_function_arguments(p.oid))
FROM 
    pg_proc p 
left outer JOIN 
    pg_namespace ns ON (p.pronamespace = ns.oid)
WHERE 
    ns.nspname = 'seu esquema' and
    p.proretset = true;
    
31.12.2018 / 15:11