About permissions on large objects - Mailing list pgsql-general

From Giuseppe Sacco
Subject About permissions on large objects
Date
Msg-id 1310543340.4632.145.camel@scarafaggio
Whole thread Raw
Responses Re: About permissions on large objects
List pgsql-general
Hi all,
I moved a few clusters from 8.4 to 9.0 since I required the new way of
authenticating against LDAP (or, in my case, AD). Now, I found the new
database version introduced permissions on large object, so my
application, in order to share large object across a group, require a
bit of change.

While the application code will be changed in order to give rights on
large objects too, I would like to know if there is any way for listing
current rights, i.e., for finding all large objects that still need to
have permissions changed.

Currently I cannot know how to distinguish what large objects have
already been granted, so I do give permissions to all large objects.
This is quite time consuming, about 5 minutes, and need to be executed a
few times per hour.

This is what I do now:

do $$
declare r record;
begin
for r in select distinct loid from pg_catalog.pg_largeobject loop
   execute 'GRANT SELECT,UPDATE ON LARGE OBJECT ' || r.loid || ' TO agenzia_r';
end loop;
end$$;

Is there a better/faster way?

Thanks,
Giuseppe


pgsql-general by date:

Previous
From: Shianmiin
Date:
Subject: Re: plpgsql function confusing behaviour
Next
From: Nicolas Grilly
Date:
Subject: Re: ts_rank seems very slow (140 ranked documents / second on my machine)