pg.ddx.io pgsql-bugs@postgresql.org mailing list archive
help / color / mirror / Atom feedBUG #17576: Event_trigger ddl_command_end not firing during CREATE PROCEDURE
3+ messages / 2 participants
[nested] [flat]
* BUG #17576: Event_trigger ddl_command_end not firing during CREATE PROCEDURE
@ 2022-08-05 16:28 PG Bug reporting form <noreply@postgresql.org>
0 siblings, 1 reply; 3+ messages in thread
From: PG Bug reporting form @ 2022-08-05 16:28 UTC (permalink / raw)
To: pgsql-bugs@lists.postgresql.org; +Cc: gabriel.franco@quintoandar.com.br
The following bug has been logged on the website:
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();
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?
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: BUG #17576: Event_trigger ddl_command_end not firing during CREATE PROCEDURE
@ 2022-08-05 17:37 David G. Johnston <david.g.johnston@gmail.com>
parent: PG Bug reporting form <noreply@postgresql.org>
0 siblings, 1 reply; 3+ messages in thread
From: David G. Johnston @ 2022-08-05 17:37 UTC (permalink / raw)
To: gabriel.franco@quintoandar.com.br, PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
On Fri, Aug 5, 2022 at 10:02 AM PG Bug reporting form <
noreply@postgresql.org> wrote:
> The following bug has been logged on the website:
>
> 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();
>
> 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@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.
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: BUG #17576: Event_trigger ddl_command_end not firing during CREATE PROCEDURE
@ 2022-08-05 17:39 David G. Johnston <david.g.johnston@gmail.com>
parent: David G. Johnston <david.g.johnston@gmail.com>
0 siblings, 0 replies; 3+ messages in thread
From: David G. Johnston @ 2022-08-05 17:39 UTC (permalink / raw)
To: gabriel.franco@quintoandar.com.br, PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
On Fri, Aug 5, 2022 at 10:37 AM David G. Johnston <
david.g.johnston@gmail.com> wrote:
>
> 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
>
Doesn't really matter but oops...
postgres=# create table evt_table_two ( id serial primary key) ;
ERROR: Event
CONTEXT: PL/pgSQL function evt_warn() line 1 at RAISE
David J.
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2022-08-05 17:39 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2022-08-05 16:28 BUG #17576: Event_trigger ddl_command_end not firing during CREATE PROCEDURE PG Bug reporting form <noreply@postgresql.org>
2022-08-05 17:37 ` David G. Johnston <david.g.johnston@gmail.com>
2022-08-05 17:39 ` David G. Johnston <david.g.johnston@gmail.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox