Re: information schema parameter_default implementation

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Amit Khandekar <amit(dot)khandekar(at)enterprisedb(dot)com>
Cc: Ali Dar <ali(dot)munir(dot)dar(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: information schema parameter_default implementation
Date: 2013-10-02 00:59:34
Message-ID: 1380675574.22785.18.camel@vanquo.pezone.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, 2013-09-18 at 20:13 +0530, Amit Khandekar wrote:
> What's the reason behind calling pg_has_role(proowner, 'USAGE') before
> calling pg_get_function_arg_default() ? :
>
> CASE WHEN pg_has_role(proowner, 'USAGE')
> THEN pg_get_function_arg_default(p_oid, (ss.x).n)
> ELSE NULL END
>
> There is already a pg_has_role() filter added while fetching the
> pg_proc entries : FROM pg_namespace n, pg_proc p
> WHERE n.oid = p.pronamespace AND
> (pg_has_role(p.proowner, 'USAGE') OR
> has_function_privilege(p.oid, 'EXECUTE'))) AS ss
>
> So the proc oid in pg_get_function_arg_default(p_oid, (ss.x).n)
> belongs to a procedure for which the current user has USAGE
> privilege.

No, the pg_proc entry belongs to a function for which the current user
is the owner *or* has EXECUTE privilege. The default, however, is only
shown to the owner. This is per SQL standard.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2013-10-02 01:33:39 Re: [PATCH] pg_upgrade: Split off pg_fatal() from pg_log()
Previous Message Peter Eisentraut 2013-10-02 00:42:46 Re: [PATCH] Revive line type