From: | Vedran Bilopavlović <vbilopav(at)gmail(dot)com> |
---|---|
To: | pgsql-bugs(at)lists(dot)postgresql(dot)org |
Subject: | BUG: value in information_schema.parameters.parameter_default is always NULL for roles t |
Date: | 2024-06-09 10:44:14 |
Message-ID: | CAMQmC4yApogF9BQLDF9V98i26f6tAvAjWpichr5P=V50VeWP_Q@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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.
--
From | Date | Subject | |
---|---|---|---|
Next Message | Alexander Lakhin | 2024-06-09 12:00:00 | Re: BUG #18483: Segmentation fault in tests modules |
Previous Message | PG Bug reporting form | 2024-06-09 06:00:00 | BUG #18500: Detaching a partition with an index manually attached to the parent's index triggers Assert |