Re: Permission on insert rules - Mailing list pgsql-sql

From Tom Lane
Subject Re: Permission on insert rules
Date
Msg-id 21306.1037197621@sss.pgh.pa.us
Whole thread Raw
In response to Re: Permission on insert rules  (Luis Sousa <llsousa@ualg.pt>)
List pgsql-sql
Luis Sousa <llsousa@ualg.pt> writes:
> When inserting, using the rule, the insert that's defined on the rule 
> works fine, but the insert defined inside the function, doesn't (that's 
> the one that gives permssion denied).

Right.  As of 7.3 you can fix this by making the function "setuid" (ie,
it runs with the permissions of the function owner, not the caller).

A rule's permission effects only extend as far as access rights to the
tables explicitly named in the rule.  Evaluation of functions appearing
in the text of the rule is done normally --- ie, as the calling user
(unless you use the new setuid-function feature).  There's been past
discussion about whether that's a good idea, but it would be quite
difficult to change it.
        regards, tom lane


pgsql-sql by date:

Previous
From: Achilleus Mantzios
Date:
Subject: Re: SET DEFAULT
Next
From: Luis Sousa
Date:
Subject: Re: Permission on insert rules