X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 8F477D1B1A0 for ; Wed, 30 Jun 2004 02:14:00 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 35124-08 for ; Wed, 30 Jun 2004 05:13:58 +0000 (GMT) Received: from joeconway.com (66-146-172-86.skyriver.net [66.146.172.86]) by svr1.postgresql.org (Postfix) with ESMTP id 6D2CDD1B198 for ; Wed, 30 Jun 2004 02:13:57 -0300 (ADT) Received: from [192.168.4.3] (account jconway HELO joeconway.com) by joeconway.com (CommuniGate Pro SMTP 4.1.8) with ESMTP-TLS id 1884126; Tue, 29 Jun 2004 22:05:56 -0700 Message-ID: <40E24C15.4040901@joeconway.com> Date: Tue, 29 Jun 2004 22:13:57 -0700 From: Joe Conway User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040510 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Tom Lane Cc: Jean-Denis Giguere , pgsql-admin@postgresql.org Subject: Re: grant execute on many functions References: <40E1E1A9.8080207@fastmail.fm> <40E1ECEF.5090007@joeconway.com> <3318.1088567114@sss.pgh.pa.us> <40E23F72.4000108@joeconway.com> <3843.1088570281@sss.pgh.pa.us> In-Reply-To: <3843.1088570281@sss.pgh.pa.us> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200406/392 X-Sequence-Number: 14052 Tom Lane wrote: > Joe Conway writes: > >> select 'GRANT EXECUTE ON ' || 1142::regprocedure; >> ERROR: array value must start with "{" or dimension information > > > BTW, it seems like there's something pretty broken here. How did > arrays get into it? A quick probe suggests that it is resolving > the above input as array_append for type regprocedure[], which would > qualify as a surprising choice in my book. 7.3 gives a more reasonable > "unable to identify an operator ||" ... array_append is defined thus: regression=# \df array_append List of functions Result data type | Schema | Name | Argument data types ------------------+------------+--------------+---------------------- anyarray | pg_catalog | array_append | anyarray, anyelement (1 row) So the "||" operator sees (unknown, regprocedure), and make_op tries to coerce the unknown literal to an array of regprocedure, which of course fails. If instead the literal is explicitly cast: select 'GRANT EXECUTE ON '::text || 1142::regprocedure; ERROR: operator does not exist: text || regprocedure HINT: No operator matches the given name and argument type(s). You may need to add explicit type casts. I'm not clear on how we can do better :(. Any suggestions? Joe