pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Joe Conway <mail@joeconway.com>
To: Stefan Hans <shans@tanagra.de>
Cc: pgsql-php Mailling List <pgsql-php@postgresql.org>
Subject: Re: Problem: has_function_privilege()
Date: Mon, 15 Mar 2004 13:42:13 -0800
Message-ID: <40562335.3030608@joeconway.com> (raw)
In-Reply-To: <008501c40ace$6638b670$bf01a8c0@pc1>
References: <008501c40ace$6638b670$bf01a8c0@pc1>

Stefan Hans wrote:
> my_example=# select has_function_privilege('postgres', 'cash_cmp', 'execute');
> 
> ERROR:  expected a left parenthesis

The documentation isn't real clear on this, but reread:
http://www.postgresql.org/docs/current/interactive/functions-misc.html
particularly this paragraph:

"has_function_privilege checks whether a user can access a function in a 
particular way. The possibilities for its arguments are analogous to 
has_table_privilege. When specifying a function by a text string rather 
than by OID, the allowed input is the same as for the regprocedure data 
type. The desired access privilege type must currently evaluate to EXECUTE."

Since function names can be overloaded in Postgres, you need to be more 
specific with your function name, i.e. provide input data types in 
parenthesis. E.g.:

regression=# select has_function_privilege('postgres', 'byteacat(bytea, 
bytea)', 'execute');
  has_function_privilege
------------------------
  t
(1 row)

HTH,

Joe




view thread (2+ messages)

Message-ID: <40562335.3030608@joeconway.com>
Permalink:  ../40562335.3030608@joeconway.com/
Also on:    postgresql.org/message-id/40562335.3030608@joeconway.com

 · 

reply

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-php@postgresql.org
  Cc: mail@joeconway.com, shans@tanagra.de
  Subject: Re: Problem: has_function_privilege()
  In-Reply-To: <40562335.3030608@joeconway.com>
  References: <008501c40ace$6638b670$bf01a8c0@pc1> <40562335.3030608@joeconway.com>

* 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