Log full DDL alter commands to a table with an event trigger

From: Sbob <sbob(at)quadratum-braccas(dot)com>
To: pgsql-admin(at)lists(dot)postgresql(dot)org
Subject: Log full DDL alter commands to a table with an event trigger
Date: 2025-01-15 18:41:36
Message-ID: 8af0a6d2-663d-413d-9463-8225500dbbf5@quadratum-braccas.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

All;

I would like to log the full alter command for any ALTER statements to a
table,  section 9.30.1 of the current docs states this:

|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.

Would there be any way to translate command to a text format and insert
it into a column in a local logging table?

Thanks in advance

Browse pgsql-admin by date

  From Date Subject
Next Message Rajesh Kumar 2025-01-15 19:24:46 Move datapath
Previous Message Day, Joseph 2025-01-15 15:47:19 Re: Need an idea to operate massive delete operation on big size table.