Re: grant execute on many functions

From: Joe Conway <mail(at)joeconway(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Jean-Denis Giguere <jdenisgiguere(at)fastmail(dot)fm>, pgsql-admin(at)postgresql(dot)org
Subject: Re: grant execute on many functions
Date: 2004-06-30 05:13:57
Message-ID: 40E24C15.4040901@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-hackers

Tom Lane wrote:
> Joe Conway <mail(at)joeconway(dot)com> 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

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Peter Eisentraut 2004-06-30 06:49:18 Re: PITR Error Message assistance
Previous Message Tom Lane 2004-06-30 04:52:25 Re: grant execute on many functions

Browse pgsql-hackers by date

  From Date Subject
Next Message Najib Abi Fadel 2004-06-30 06:39:29 Creating a selective aggregate ??
Previous Message Tom Lane 2004-06-30 04:52:25 Re: grant execute on many functions