Re: Problem: has_function_privilege()

From: Joe Conway <mail(at)joeconway(dot)com>
To: Stefan Hans <shans(at)tanagra(dot)de>
Cc: pgsql-php Mailling List <pgsql-php(at)postgresql(dot)org>
Subject: Re: Problem: has_function_privilege()
Date: 2004-03-15 21:42:13
Message-ID: 40562335.3030608@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-php

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

In response to

Browse pgsql-php by date

  From Date Subject
Next Message aleyva 2004-03-16 02:14:24 FUNCTIONS
Previous Message Stefan Hans 2004-03-15 20:45:06 Problem: has_function_privilege()