Re: GRANT ROLE and triggers - Mailing list pgsql-hackers

From Richard Huxton
Subject Re: GRANT ROLE and triggers
Date
Msg-id 468CA169.8080304@archonet.com
Whole thread Raw
In response to GRANT ROLE and triggers  ("Claudio Rossi" <wind.claudio@inwind.it>)
List pgsql-hackers
Claudio Rossi wrote:
> Hello, I'm trying to write a trigger function which uses GRANT ROLE
> statement. Scenario is: I have a group role (let's call it A) which
> has not superuser privileges and I want to grant A membership to
> current user after an insert on a particular table, then revoke it
> after a delete on it; I write trigger function as superuser then I
> normally login as unprivileged user. 

I think you want to define your function as SECURITY DEFINER, then it'll 
do what you want.

This isn't a hackers question by the way, the hackers list is for 
developing PostgreSQL itself. This question is better suited to the 
general / sql / admin lists perhaps.

--   Richard Huxton  Archonet Ltd


pgsql-hackers by date:

Previous
From: Michael Paesold
Date:
Subject: Re: Still recommending daily vacuum...
Next
From: "Simon Riggs"
Date:
Subject: Re: SetBufferCommitInfoNeedsSave and race conditions