Re: Proposal for CREATE OR REPLACE EVENT TRIGGER in PostgreSQL

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Peter Burbery <petercullenburbery(at)gmail(dot)com>
Cc: "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Proposal for CREATE OR REPLACE EVENT TRIGGER in PostgreSQL
Date: 2024-05-04 02:22:18
Message-ID: CAKFQuwaDdxxH97e4HONKxvGE7OyvPGAm6bkfL+wV3vbkAzr3BQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Friday, May 3, 2024, Peter Burbery <petercullenburbery(at)gmail(dot)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(dot)cullen(dot)burbery(at)gmail(dot)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.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrey M. Borodin 2024-05-04 06:09:04 Re: UUID v7
Previous Message David Rowley 2024-05-04 02:01:48 Re: Use generation memory context for tuplestore.c