pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Neethu P <neeth_3@hotmail.com>
To: pgsql-general <pgsql-general@postgresql.org>
Subject: Re: Event Triggers unable to capture the DDL script executed
Date: Wed, 22 Feb 2023 10:51:33 +0100
Message-ID: <714b89f449005ed4348e2114f6ce5f8aff18ea8a.camel@cybertec.at> (raw)
In-Reply-To: <BN6PR12MB17799C4D94EC259180F8EB69D1AA9@BN6PR12MB1779.namprd12.prod.outlook.com>
References: <BN6PR12MB17799C4D94EC259180F8EB69D1AA9@BN6PR12MB1779.namprd12.prod.outlook.com>

On Wed, 2023-02-22 at 07:57 +0000, Neethu P wrote:
> We are using event triggers to capture the DDL changes in a postgres database.
> However, we are unable to get the column information & the actual DDL script
> executed, while a table is altered. 
> Also, in the postgres documentation for pg_event_trigger_ddl_commands ()- it is mentioned as below.
> pg_ddl_command	A complete representation of the command, in internal
> format. Thiscannot be output directly, but it can be passed to other functions
> to obtain different pieces of information about the command.
> 
> Is it possible to access pg_ddl_command in postgresql? Or is there any scripts
> which can help to get theactual Alter DDL statement that was executed by the user? 

That is simple if you write the event trigger in C.  I would say that that is the
only way to get at the actual statement.

Yours,
Laurenz Albe





view thread (8+ messages)  latest in thread

Message-ID: <714b89f449005ed4348e2114f6ce5f8aff18ea8a.camel@cybertec.at>
Permalink:  ../714b89f449005ed4348e2114f6ce5f8aff18ea8a.camel@cybertec.at/
Also on:    postgresql.org/message-id/714b89f449005ed4348e2114f6ce5f8aff18ea8a.camel@cybertec.at

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: laurenz.albe@cybertec.at, neeth_3@hotmail.com
  Subject: Re: Event Triggers unable to capture the DDL script executed
  In-Reply-To: <714b89f449005ed4348e2114f6ce5f8aff18ea8a.camel@cybertec.at>
  References: <BN6PR12MB17799C4D94EC259180F8EB69D1AA9@BN6PR12MB1779.namprd12.prod.outlook.com> <714b89f449005ed4348e2114f6ce5f8aff18ea8a.camel@cybertec.at>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox