0

Asuming I have a table myTable that stores:

  id   |   tableName
 ---------------------
   1   |     a
   2   |     b
  ...  |    ...

I have event triggers for CREATE TABLE / DROP TABLE events that updates the table "myTable". Now I want to handle table renames to have a "right" reference in "myTable" when a table is renamed. I have tried listening for ddl_command_end event but I need to access to the original table name.

According to the docs :

pg_event_trigger_ddl_commands()

command pg_ddl_command A complete representation of the command, in internal format. This cannot be output directly, but it can be passed to other functions to obtain different pieces of information about the command.

But there's no link showing functions to extract the pieces I need.

How can this be done?

Jose Hermosilla Rodrigo
  • 3,513
  • 6
  • 22
  • 38

0 Answers0