X-Original-To: pgsql-php-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id A8529D1C968 for ; Mon, 15 Mar 2004 21:46:26 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 00722-10 for ; Mon, 15 Mar 2004 17:46:26 -0400 (AST) Received: from joeconway.com (66-146-172-86.skyriver.net [66.146.172.86]) by svr1.postgresql.org (Postfix) with ESMTP id 8CEFED1C952 for ; Mon, 15 Mar 2004 17:46:23 -0400 (AST) Received: from [206.19.64.3] (account jconway HELO joeconway.com) by joeconway.com (CommuniGate Pro SMTP 4.1.8) with ESMTP-TLS id 1085239; Mon, 15 Mar 2004 13:41:50 -0800 Message-ID: <40562335.3030608@joeconway.com> Date: Mon, 15 Mar 2004 13:42:13 -0800 From: Joe Conway User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.6) Gecko/20040113 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Stefan Hans Cc: pgsql-php Mailling List Subject: Re: Problem: has_function_privilege() References: <008501c40ace$6638b670$bf01a8c0@pc1> In-Reply-To: <008501c40ace$6638b670$bf01a8c0@pc1> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200403/33 X-Sequence-Number: 2632 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