Re: About permissions on large objects

From: Giuseppe Sacco <giuseppe(at)eppesuigoccas(dot)homedns(dot)org>
To: PostgreSQL <pgsql-general(at)postgresql(dot)org>
Subject: Re: About permissions on large objects
Date: 2011-07-15 09:39:45
Message-ID: 1310722785.4673.12.camel@scarafaggio
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi Howard,

Il giorno mer, 13/07/2011 alle 23.30 +0100, Howard Cole ha scritto:
> Hi Guiseppe,
>
> Perhaps you can create a trigger that monitors for the insertion of an
> oid and then grant permissions. No idea if this can be done, but if it
> can it will save you lots of repeated grants.
[...]

Thanks for your tip. I already created a trigger on all my tables, as
this one:

CREATE OR REPLACE FUNCTION grant_large_object() RETURNS trigger AS '
BEGIN
execute ''GRANT SELECT,UPDATE ON LARGE OBJECT '' || NEW.IMAGE || '' TO agenzia_r'';
RETURN NEW;
END;'
LANGUAGE 'plpgsql';

CREATE TRIGGER grant_large_object
AFTER INSERT OR UPDATE ON agenzia.imagebydocument
FOR EACH ROW EXECUTE PROCEDURE grant_large_object();

And it seems to be working right. I still would like to know if there is
any way to query acl metadata, maybe from table
pg_catalog.pg_largeobject_metadata in order to collect information about
granted rights on large objects.

Bye,
Giuseppe

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tony Wang 2011-07-15 10:36:19 Re: Weird problem that enormous locks
Previous Message Gregor Trefs 2011-07-15 08:50:49 C function returns null values