Re: BUG #17576: Event_trigger ddl_command_end not firing during CREATE PROCEDURE

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: gabriel(dot)franco(at)quintoandar(dot)com(dot)br, PostgreSQL mailing lists <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: BUG #17576: Event_trigger ddl_command_end not firing during CREATE PROCEDURE
Date: 2022-08-05 17:37:34
Message-ID: CAKFQuwao9dOav1xPJW_tOhJpES9vO0XjmWLSqVtahyTAf15siw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Fri, Aug 5, 2022 at 10:02 AM PG Bug reporting form <
noreply(at)postgresql(dot)org> wrote:

> The following bug has been logged on the website:
>
> Bug reference: 17576
> Logged by: Gabriel Rodrigues Franco
> Email address: gabriel(dot)franco(at)quintoandar(dot)com(dot)br
> PostgreSQL version: 13.4
> Operating system: Its and Amazon RDS
> Description:
>
> Hello PostgreSQL team,
>
> I have a FUNCTION that needs to be executed after any object creation
> (tables, functions, procedures...), and it is triggering as expected for
> any
> DDL operation against tables and functions, but not for PROCEDURES.
>
> CREATE EVENT TRIGGER tg_change_obj_owner ON ddl_command_end
> EXECUTE FUNCTION public.pg_change_obj_owner();
>
> I saw in the Matrix that this was not supposed to happen:
> https://www.postgresql.org/docs/current/event-trigger-matrix.html
>
> Could you help me?
>
>
I cannot reproduce this.

vagrant(at)vagrant:/usr/local/pgsql/bin$ ./psql postgres
psql (13.4)
Type "help" for help.

postgres=# create function evt_warn() returns event_trigger as $$begin
raise exception 'Event'; end; $$ language plpgsql;
CREATE FUNCTION
postgres=# create table evt_table ( id serial primary key) ;
CREATE TABLE
postgres=# CREATE EVENT TRIGGER tg_change_obj_owner ON ddl_command_end
EXECUTE FUNCTION public.evt_warn();
CREATE EVENT TRIGGER
postgres=# create table evt_table ( id serial primary key) ;
ERROR: relation "evt_table" already exists
postgres=# create procedure evt_warn_proc() as $$begin raise notice
'Notice'; end;$$ language plpgsql;
ERROR: Event
CONTEXT: PL/pgSQL function evt_warn() line 1 at RAISE
postgres=#

I suggest upgrading your RDS to the most current version available, trying
again, and if you still have issues contact AWS for support.

Feel free to provide a self-contained producer and output from your
environment here if you'd like though. It will be informative even if the
problem really is with RDS.

David J.

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message David G. Johnston 2022-08-05 17:39:33 Re: BUG #17576: Event_trigger ddl_command_end not firing during CREATE PROCEDURE
Previous Message PG Bug reporting form 2022-08-05 16:28:21 BUG #17576: Event_trigger ddl_command_end not firing during CREATE PROCEDURE