pg.ddx.io pgsql-docs@postgresql.org mailing list archive
help / color / mirror / Atom feeddrop table doesn't fire ddl_command_end event trigger
2+ messages / 2 participants
[nested] [flat]
* drop table doesn't fire ddl_command_end event trigger
@ 2017-09-25 13:42 sanyamjain22@live.in
2017-09-25 20:56 ` Re: drop table doesn't fire ddl_command_end event trigger Euler Taveira <euler@timbira.com.br>
0 siblings, 1 reply; 2+ messages in thread
From: sanyamjain22@live.in @ 2017-09-25 13:42 UTC (permalink / raw)
To: pgsql-docs
The following documentation comment has been logged on the website:
Page: https://www.postgresql.org/docs/9.6/static/event-trigger-matrix.html
Description:
Hi,
I have enable ddl_command_end trigger on a table.I can see fired events when
ddl type is alter or create but drop is not catched. But in description
https://www.postgresql.org/docs/9.6/static/event-trigger-matrix.html
it is mentioned that drop table will also generate ddl_command_end trigger.
--
Sent via pgsql-docs mailing list (pgsql-docs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-docs
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: drop table doesn't fire ddl_command_end event trigger
2017-09-25 13:42 drop table doesn't fire ddl_command_end event trigger sanyamjain22@live.in
@ 2017-09-25 20:56 ` Euler Taveira <euler@timbira.com.br>
0 siblings, 0 replies; 2+ messages in thread
From: Euler Taveira @ 2017-09-25 20:56 UTC (permalink / raw)
To: sanyamjain22@live.in; +Cc: pgsql-docs
2017-09-25 10:42 GMT-03:00 <sanyamjain22@live.in>:
> I have enable ddl_command_end trigger on a table.I can see fired events when
> ddl type is alter or create but drop is not catched. But in description
> https://www.postgresql.org/docs/9.6/static/event-trigger-matrix.html
> it is mentioned that drop table will also generate ddl_command_end trigger.
>
You don't show a test case. It works for me.
--
-- Extracted from manual [1]
--
CREATE FUNCTION test_event_trigger_for_drops()
RETURNS event_trigger LANGUAGE plpgsql AS $$
DECLARE
obj record;
BEGIN
FOR obj IN SELECT * FROM pg_event_trigger_dropped_objects()
LOOP
RAISE NOTICE '% dropped object: % %.% %',
tg_tag,
obj.object_type,
obj.schema_name,
obj.object_name,
obj.object_identity;
END LOOP;
END
$$;
CREATE EVENT TRIGGER test_event_trigger_for_drops
ON sql_drop
EXECUTE PROCEDURE test_event_trigger_for_drops();
$ psql
psql (9.6.2)
Digite "help" para ajuda.
euler=# CREATE TYPE foo AS (f1 int, f2 text);
CREATE TYPE
euler=# drop type foo;
NOTICE: DROP TYPE dropped object: type public.foo public.foo
NOTICE: DROP TYPE dropped object: composite type public.foo public.foo
NOTICE: DROP TYPE dropped object: type public._foo public.foo[]
DROP TYPE
[1] https://www.postgresql.org/docs/9.6/static/functions-event-triggers.html
--
Euler Taveira Timbira -
http://www.timbira.com.br/
PostgreSQL: Consultoria, Desenvolvimento, Suporte 24x7 e Treinamento
--
Sent via pgsql-docs mailing list (pgsql-docs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-docs
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2017-09-25 20:56 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2017-09-25 13:42 drop table doesn't fire ddl_command_end event trigger sanyamjain22@live.in
2017-09-25 20:56 ` Euler Taveira <euler@timbira.com.br>
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