From: Tom Lane <tgl@sss.pgh.pa.us>
To: Vedran Bilopavlović <vbilopav@gmail.com>
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG: value in information_schema.parameters.parameter_default is always NULL for roles t
Date: Sun, 09 Jun 2024 13:06:20 -0400
Message-ID: <541707.1717952780@sss.pgh.pa.us> (raw)
In-Reply-To: <CAMQmC4yApogF9BQLDF9V98i26f6tAvAjWpichr5P=V50VeWP_Q@mail.gmail.com>
References: <CAMQmC4yApogF9BQLDF9V98i26f6tAvAjWpichr5P=V50VeWP_Q@mail.gmail.com>
=?UTF-8?Q?Vedran_Bilopavlovi=C4=87?= <vbilopav@gmail.com> writes:
> Values in table *information_schema.parameters*, column *parameter_default*,
> are always NULL only for roles that are not superuser.
I see no bug there. The manual defines parameter_default as
The default expression of the parameter, or null if none or if the
function is not owned by a currently enabled role.
A superuser is considered to own everything, but for mere-mortal
roles a result would only appear for functions you own. The
SQL implementation of the view appears to match this definition:
CASE WHEN pg_has_role(proowner, 'USAGE')
THEN pg_get_function_arg_default(p_oid, (ss.x).n)
ELSE NULL END
You could certainly quibble with the value of hiding the information
when it's readily available from our system catalogs --- but this
is a SQL-standard-defined view so we implement it as the standard
says, and this is what the standard says it should do.
> There is a workaround by using pg_proc table:
I'd recommend using something from the pg_get_function*() family.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, vbilopav@gmail.com, pgsql-bugs@lists.postgresql.org
Subject: Re: BUG: value in information_schema.parameters.parameter_default is always NULL for roles t
In-Reply-To: <541707.1717952780@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox