BUG: value in information_schema.parameters.parameter_default is always NULL for roles t - Mailing list pgsql-bugs

From Vedran Bilopavlović
Subject BUG: value in information_schema.parameters.parameter_default is always NULL for roles t
Date
Msg-id CAMQmC4yApogF9BQLDF9V98i26f6tAvAjWpichr5P=V50VeWP_Q@mail.gmail.com
Whole thread Raw
Responses Re: BUG: value in information_schema.parameters.parameter_default is always NULL for roles t
List pgsql-bugs
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.
--

pgsql-bugs by date:

Previous
From: PG Bug reporting form
Date:
Subject: BUG #18500: Detaching a partition with an index manually attached to the parent's index triggers Assert
Next
From: Alexander Lakhin
Date:
Subject: Re: BUG #18483: Segmentation fault in tests modules