Re: Scripting GRANT on functions
| От | Tom Lane |
|---|---|
| Тема | Re: Scripting GRANT on functions |
| Дата | |
| Msg-id | 16713.1128605589@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Scripting GRANT on functions ("Stewart Ben (RBAU/EQS4) *" <Ben.Stewart@au.bosch.com>) |
| Список | pgsql-sql |
"Stewart Ben (RBAU/EQS4) *" <Ben.Stewart@au.bosch.com> writes:
> Is there any easy way to script granting privileges to a number of
> functions? I've got as far as the following code before realising that
> I'll need to pass in the arguments, and the arguments are stored as OIDs
> in pg_proc.
> Is there any easy way, such as GRANT .... FUNCTION OID 12345?
Coerce the OID to regprocedure to generate a usable name for the
function.
regression=# select oid from pg_proc limit 5;oid
------124212431244 311245
(5 rows)
regression=# select oid::regprocedure from pg_proc limit 5; oid
------------------boolin(cstring)boolout(boolean)byteain(cstring)byteaout(bytea)charin(cstring)
(5 rows)
regression=#
regards, tom lane
В списке pgsql-sql по дате отправления: