Re: information schema parameter_default implementation - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: information schema parameter_default implementation
Date
Msg-id 1380675574.22785.18.camel@vanquo.pezone.net
Whole thread Raw
In response to Re: information schema parameter_default implementation  (Amit Khandekar <amit.khandekar@enterprisedb.com>)
List 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.





pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: [PATCH] Revive line type
Next
From: Peter Eisentraut
Date:
Subject: Re: [PATCH] pg_upgrade: Split off pg_fatal() from pg_log()