A program produces the wrong output for any given input:
Values in table information_schema.parameters, column parameter_default, are always NULL only for roles that are not superuser.
The same column returns the correct values for superuser roles.
There is a workaround by using pg_proc table:
select
unnest(proargnames[pronargs-pronargdefaults+1:pronargs] )optargnames,
unnest(string_to_array(pg_get_expr(proargdefaults, 0)::text,',')) optargdefaults
from
pg_catalog.pg_proc
where
proname = 'proc name'
However, this approach relies on CSV parsing and will return wrong results when the parameter default contains a comma.