Re: Generating GRANT/REVOKE on functions from catalog - Mailing list pgsql-general

From Doug Gorley
Subject Re: Generating GRANT/REVOKE on functions from catalog
Date
Msg-id 4A79CBF3.4010602@gmail.com
Whole thread Raw
In response to Re: Generating GRANT/REVOKE on functions from catalog  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Generating GRANT/REVOKE on functions from catalog  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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.gorley@gmail.com <mailto:doug.gorley@gmail.com>




Tom Lane wrote:
> Doug Gorley <doug.gorley@gmail.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
>

pgsql-general by date:

Previous
From: Sam Mason
Date:
Subject: Re: Update Query doesn't affect all records
Next
From: Tom Lane
Date:
Subject: Re: Generating GRANT/REVOKE on functions from catalog