i looked for a event trigger which fired up after creation of a table. I found some good posts here and do some test. My problem is that nothing happens, no errors nor output. So please give some advice what i do wrong. Here my code. I'am complete new in postgres, come from oracle, so please forgive me for this maybe "simple" question.
create table createt (tname char(20));
CREATE OR REPLACE FUNCTION insert()
RETURNS event_trigger
AS $$
DECLARE r RECORD;
BEGIN
r := pg_event_trigger_ddl_commands();
INSERT INTO createt VALUES(r.object_identity);
END;
$$
LANGUAGE plpgsql;
CREATE EVENT TRIGGER insert_event ON ddl_command_end
WHEN TAG IN ('CREATE TABLE')
EXECUTE PROCEDURE insert();
So in this testcase i want to put the tablename of the newly createt table in the table createt! But nothing happens. How can i check if the trigger is fired up. Or how can i debug the function?
Thanks for your time and advices.