Re: BUG: value in information_schema.parameters.parameter_default is always NULL for roles t

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG: value in information_schema.parameters.parameter_default is always NULL for roles t
Дата
Msg-id 541707.1717952780@sss.pgh.pa.us
обсуждение исходный текст
Ответ на BUG: value in information_schema.parameters.parameter_default is always NULL for roles t  (Vedran Bilopavlović <vbilopav@gmail.com>)
Список pgsql-bugs
=?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



В списке pgsql-bugs по дате отправления:

Предыдущее
От: Alexander Lakhin
Дата:
Сообщение: Re: BUG #18483: Segmentation fault in tests modules
Следующее
От: Masahiko Sawada
Дата:
Сообщение: Re: BUG #18483: Segmentation fault in tests modules