Re: FOR SHARE permissions - Mailing list pgsql-admin

From Tom Lane
Subject Re: FOR SHARE permissions
Date
Msg-id 4447.1292170279@sss.pgh.pa.us
Whole thread Raw
In response to FOR SHARE permissions  (David Underhill <dound07@gmail.com>)
Responses Re: FOR SHARE permissions  (David Underhill <dound07@gmail.com>)
List pgsql-admin
David Underhill <dound07@gmail.com> writes:
> I have two tables.  One has a foreign key referencing a serial field in the
> other table.  I've given INSERT privilege to a role other than the owner,
> but I still can't insert into the table containing the foreign key unless I
> grant the *owner* of the table UPDATE privilege on the table containing the
> referenced field.
> I don't quite understand why the *owner* needs to have UPDATE permission in
> order for another distinct role (with INSERT privilege) to be able to insert
> a row in this case.

The owner is the one who established the foreign key reference.  That
reference is no concern of the third-party user who's been given insert
permission on the referencing table.  The design you seem to have in
mind would make management of permissions a lot more complicated, since
instead of just granting insert permission to the third party, you'd
have to think about all the subsidiary permissions that might be needed
to deal with the table's FK linkages.

            regards, tom lane

pgsql-admin by date:

Previous
From: David Underhill
Date:
Subject: FOR SHARE permissions
Next
From: savio rodriges
Date:
Subject: Urgent -- Very HIGH memory usage on PostgreSQL server