Bug reference: 17576 Logged by: Gabriel Rodrigues Franco Email address: gabriel.franco@quintoandar.com.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();
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.