Re: Allow database owners to CREATE EVENT TRIGGER - Mailing list pgsql-hackers

From David G. Johnston
Subject Re: Allow database owners to CREATE EVENT TRIGGER
Date
Msg-id CAKFQuwZN4Emb5-WkyHYn4fCc5fw9QxcAYy9AYfUM=uJdRMZ+6A@mail.gmail.com
Whole thread Raw
In response to Re: Allow database owners to CREATE EVENT TRIGGER  (Steve Chavez <steve@supabase.io>)
Responses Re: Allow database owners to CREATE EVENT TRIGGER
List pgsql-hackers
On Tuesday, April 22, 2025, Steve Chavez <steve@supabase.io> wrote:
>  alter event trigger command which doesn’t need to be exercised here

That part does need to be tested, I modified `AlterEventTriggerOwner_internal` to allow altering owners to regular users. Before it was only restricted to superusers.

> Actually, leave the other member around, but not granted ownership, and both create tables, to demonstrate that a non-superuser and non-owner is unaffected by the trigger.

I've updated the tests accordingly. Please let me know if that's what you had in mind.

Pretty much.  You have a bad drop table cleanup command, and I’d drop the entire alter event trigger owner test.

The other thing I’m wondering, but haven’t gotten around to testing, is whether a role affected by the event trigger is able to just drop the trigger given this implementation.  I always get member/member-of dynamics confused.  Having member (possibly via set role…) trying to drop the trigger would be good to prove that it isn’t allowed.

David J.

pgsql-hackers by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: DOCS - create publication (tweak for generated columns)
Next
From: "David G. Johnston"
Date:
Subject: Re: Allow database owners to CREATE EVENT TRIGGER