Re: Proposal for CREATE OR REPLACE EVENT TRIGGER in PostgreSQL - Mailing list pgsql-hackers

From David G. Johnston
Subject Re: Proposal for CREATE OR REPLACE EVENT TRIGGER in PostgreSQL
Date
Msg-id CAKFQuwaDdxxH97e4HONKxvGE7OyvPGAm6bkfL+wV3vbkAzr3BQ@mail.gmail.com
Whole thread Raw
In response to Proposal for CREATE OR REPLACE EVENT TRIGGER in PostgreSQL  (Peter Burbery <petercullenburbery@gmail.com>)
List pgsql-hackers
On Friday, May 3, 2024, Peter Burbery <petercullenburbery@gmail.com> wrote:
Dear pgsql-hackers,

One-line Summary:
Proposal to introduce the CREATE OR REPLACE syntax for EVENT TRIGGER in PostgreSQL.

Business Use-case:
Currently, to modify an EVENT TRIGGER, one must drop and recreate it. This proposal aims to introduce a CREATE OR REPLACE syntax for EVENT TRIGGER, similar to other database objects in PostgreSQL, to simplify this process and improve usability.

Contact Information:
Peter Burbery
peter.cullen.burbery@gmail.com

I look forward to your feedback on this proposal.

Its doesn’t seem like that big an omission, especially since unlike views and functions you can’t actually affect dependencies on an event trigger.  But the same can be said of normal triggers and they already have an “or replace” option.  So, sure, if you come along and offer a patch for this it seems probable it would be accepted.  I’d just be a bit sad it probably would take away from time that could spent on more desirable features.

As for your proposal format, it is a quite confusing presentation to send to an open source project.  Also, your examples are overly complex, and crammed together, for the purpose and not enough effort is spent actually trying to demonstrate why this is needed when “drop if exists” already is present.  A much better flow is to conditionally drop the existing object and create the new one all in the same transaction.

David J.

pgsql-hackers by date:

Previous
From: David Rowley
Date:
Subject: Re: Use generation memory context for tuplestore.c
Next
From: "Andrey M. Borodin"
Date:
Subject: Re: UUID v7