Re: Event Triggers unable to capture the DDL script executed - Mailing list pgsql-general

From Laurenz Albe
Subject Re: Event Triggers unable to capture the DDL script executed
Date
Msg-id 290a168f249e238c9059c31f21db980c2a57b4f6.camel@cybertec.at
Whole thread Raw
In response to Re: Event Triggers unable to capture the DDL script executed  (Neethu P <neeth_3@hotmail.com>)
Responses Re: Event Triggers unable to capture the DDL script executed  (Neethu P <neeth_3@hotmail.com>)
Re: Event Triggers unable to capture the DDL script executed  (Neethu P <neeth_3@hotmail.com>)
List pgsql-general
On Thu, 2023-02-23 at 04:10 +0000, Neethu P wrote:
> Actually, current_query() may not help us in our case, as we won't be able
> to capture the ddl statement completely in case if it's in multiple lines.

Multiple lines should not be a problem.  The problems I see are

- you won't catch DDL statements issued in a function with that, since you
  only see the top-level statement

- if you have the DDL statement as string, you need to parse it, which is
  non-trivial

> Can you please help me with the event trigger in C? & also how can we
> integrate it with our current postgresql DB?

In an e-mail, I cannot do much beyond pointing you to the documentation:
https://www.postgresql.org/docs/current/event-trigger-interface.html
There is also a simple example:
https://www.postgresql.org/docs/current/event-trigger-example.html

Getting used to reading and writing PostgreSQL server code takes a while.

Yours,
Laurenz Albe



pgsql-general by date:

Previous
From: Neethu P
Date:
Subject: Re: Event Triggers unable to capture the DDL script executed
Next
From: Neethu P
Date:
Subject: Re: Event Triggers unable to capture the DDL script executed