Re: Generating GRANT/REVOKE on functions from catalog

From: Doug Gorley <doug(dot)gorley(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Generating GRANT/REVOKE on functions from catalog
Date: 2009-08-05 18:14:11
Message-ID: 4A79CBF3.4010602@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Perfect, I'm using the following function:

create or replace function fn_sig(p_oid oid) returns text
as $$
begin
return p_oid::regprocedure;
end;
$$ language plpgsql;

In the following query:

select
pg_namespace.nspname ||
'.' ||
fn_sig(pg_proc.oid)
from
pg_proc
inner join pg_namespace
on pg_proc.pronamespace = pg_namespace.oid

Thanks very much!

------------------------------------------------------------------------
*Doug Gorley* | doug(dot)gorley(at)gmail(dot)com <mailto:doug(dot)gorley(at)gmail(dot)com>

Tom Lane wrote:
> Doug Gorley <doug(dot)gorley(at)gmail(dot)com> writes:
>
>> That looks like exactly what I want. Is there an easy way to cast that
>> to a string so that I can concatenate it into a GRANT statement?
>>
>
> Well, since 8.3 you just cast it to a string ;-)
>
> In older versions I'd suggest a plpgsql wrapper function. plpgsql has
> always been very lax about letting you assign anything to anything,
> so you can cast by assignment.
>
> regards, tom lane
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2009-08-05 18:19:13 Re: Generating GRANT/REVOKE on functions from catalog
Previous Message Sam Mason 2009-08-05 17:33:19 Re: Update Query doesn't affect all records