From shans@tanagra.de Mon Mar 15 20:46:24 2004 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 887ADD1CAD0 for ; Mon, 15 Mar 2004 20:46:24 +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 80156-10 for ; Mon, 15 Mar 2004 16:46:23 -0400 (AST) Received: from popmail.space.net (popmail.Space.Net [195.30.0.14]) by svr1.postgresql.org (Postfix) with SMTP id DFCB2D1C9E1 for ; Mon, 15 Mar 2004 16:46:18 -0400 (AST) Received: (qmail 94887 invoked from network); 15 Mar 2004 20:46:16 -0000 Received: from pd9e89356.dip0.t-ipconnect.de (HELO pc1) (217.232.147.86) by popmail.space.net with SMTP; 15 Mar 2004 20:46:16 -0000 X-SpaceNet-Authentification: SMTPafterPOP verified Message-ID: <008501c40ace$6638b670$bf01a8c0@pc1> From: "Stefan Hans" To: "pgsql-php Mailling List" Subject: Problem: has_function_privilege() Date: Mon, 15 Mar 2004 21:45:06 +0100 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0082_01C40AD6.C7B9D3E0" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.4 tagged_above=0.0 required=5.0 tests=BAYES_44, HTML_50_60, HTML_MESSAGE, RCVD_IN_NJABL, RCVD_IN_SORBS X-Spam-Level: X-Archive-Number: 200403/32 X-Sequence-Number: 2631 This is a multi-part message in MIME format. ------=_NextPart_000_0082_01C40AD6.C7B9D3E0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi *, can somebody help to solve this? [has_function_privilege(user, function, privilege)]: my_example=3D# select has_function_privilege('postgres', 'cash_cmp', 'execu= te'); ERROR: expected a left parenthesis [has_function_privilege(function, privilege) ]: my_example=3D# select has_function_privilege('cash_cmp', 'execute'); ERROR: expected a left parenthesis =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 ---------------------------------------------------------------------------= ---------------------------- PostgreSQL 7.4 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 3.2.2 20030= 222 (Red Hat Linux 3.2.2-5) thx in advance greetings from munich stefan ------=_NextPart_000_0082_01C40AD6.C7B9D3E0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi *,
 
can somebody help to solve this?
 
[has_function_privilege(user, function, privilege)]:
 
my_example=3D# select=20 has_function_privilege('postgres', 'cash_cmp', 'execute');

ERROR:  expected a left parenthesis
 
 
[has_function_privilege(function, privilege)=20 ]:

my_example=3D# select has_function_privilege('cash_cmp',=20 'execute');

ERROR:  expected a left=20 parenthesis
          =             &nb= sp;            =             &nb= sp;            =           =20
-----------------------------------------------------------------------= --------------------------------
 PostgreSQL=20 7.4 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 3.2.2 20030222 (Red Hat= =20 Linux 3.2.2-5)
 
 
thx in advance
 
greetings from munich
 
stefan
 
------=_NextPart_000_0082_01C40AD6.C7B9D3E0-- From mail@joeconway.com Mon Mar 15 21:46:26 2004 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