You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
left join pg_catalog.pg_description des on proc.oid = des.objoid
group by
r.routine_type,
r.specific_schema,
r.routine_name,
r.specific_name,
r.data_type,
r.type_udt_schema,
r.type_udt_name,
r.return_type,
r.is_user_defined,
des.description,
proc.oid,
proc.proisstrict,
proc.procost,
proc.prorows,
proc.proparallel,
proc.provolatile,
proc.proretset,
proc.provariadic
)
select
type,
r1.schema,
r1.name,
comment,
is_strict,
volatility_option,
returns_set,
case when custom_types.col_name is not null then 'record' else coalesce(return_type, 'void') end as return_type,
array_length(coalesce(custom_types.col_name, case when array_length(r1.out_params, 1) is null then array[r1.name]::text[] else r1.out_params end), 1) as return_record_count,
coalesce(custom_types.col_name, case when array_length(r1.out_params, 1) is null then array[r1.name]::text[] else r1.out_params end) as return_record_names,
coalesce(custom_types.col_type, case when array_length(r1.out_param_types, 1) is null then array[return_type]::text[] else r1.out_param_types end) as return_record_types,
coalesce(custom_types.col_type, r1.out_params) = '{}' as is_unnamed_record,
array_length(in_params, 1) as param_count,
in_params as param_names,
in_param_types as param_types,
arguments_def,
has_variadic,
pg_get_functiondef(oid) as definition,
custom_param_type_names,
custom_param_type_types,
custom_param_type_positions,
case when custom_types.col_name is not null then null else custom_rec_type_names end as custom_rec_type_names,
case when custom_types.col_name is not null then null else custom_rec_type_types end as custom_rec_type_types
from _routine_aggs r1
left join lateral (
select array_agg(t.att_name order by t.att_pos) as col_name, array_agg(t.att_type order by t.att_pos) as col_type