I set up the following to log all DDLs executed in the database: CREATE TABLE log_ddl_info(ddl_tag text, ddl_event text, ddl_time timestamp);
CREATE OR REPLACE FUNCTION log_ddl_execution() RETURNS event_trigger AS $$ DECLARE insertquery TEXT; BEGIN insertquery := 'INSERT INTO log_ddl_info VALUES (''' || tg_tag ||''', ''' || tg_event || ''', statement_timestamp())'; EXECUTE insertquery; RAISE NOTICE 'Recorded execution of command % with event %', tg_tag, tg_event; END; $$ LANGUAGE plpgsql; CREATE EVENT TRIGGER log_ddl_info_start ON ddl_command_start EXECUTE PROCEDURE log_ddl_execution(); CREATE EVENT TRIGGER log_ddl_info_end ON ddl_command_end EXECUTE PROCEDURE log_ddl_execution(); Is there a way to log the object name (or the oid) in the function? Thank you, ________________ Ramya Vasudevan Database Administrator CLASSMATES 333 Elliott Ave. West, Suite 500 Seattle, WA 98119 206.301.4933 o