Thanks. This is helpful. Below is the result when I add a column to public.accounts.
obj.classid, -- 1259
obj.objid, -- 16409
obj.objsubid, -- 0
obj.command_tag, -- ALTER TABLE
obj.object_type, -- table
obj.schema_name, -- public
obj.object_identity, -- public.accounts
obj.in_extension; -- f
The info useful for me is command_tag, object_type, object_identity.
classid, objid is not useful since object_identity is more explicit.
objsubid is not useful because I don't need
comment information for schema change.
Besides table name, I still need:
* which columns are added and their types.
* which columns have type change, the old and new types.
* which columns are dropped.
Will
command field provide this info? I don't have an example and decoding it needs C code. If I cannot get such info from pg_event_trigger_ddl_commands, I may need to maintain schema snapshots myself and diff the old and new snapshots upon an alter table/view event. Which way should I go? Thanks a lot.