Re: GRANT ROLE and triggers

From: Richard Huxton <dev(at)archonet(dot)com>
To: Claudio Rossi <wind(dot)claudio(at)inwind(dot)it>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: GRANT ROLE and triggers
Date: 2007-07-05 07:44:41
Message-ID: 468CA169.8080304@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2007-07-05 07:46:32 Re: SetBufferCommitInfoNeedsSave and race conditions
Previous Message Michael Paesold 2007-07-05 07:30:17 Re: Still recommending daily vacuum...