Re: Getting the exact SQL from inside an event trigger - Mailing list pgsql-general

From Joe Wildish
Subject Re: Getting the exact SQL from inside an event trigger
Date
Msg-id 27d484ae-98b0-44aa-8718-7fda1387b5b8@app.fastmail.com
Whole thread Raw
In response to Re: Getting the exact SQL from inside an event trigger  (hubert depesz lubaczewski <depesz@depesz.com>)
List pgsql-general
Hi Depesz,

On Thu, 2 Mar 2023, at 12:29, hubert depesz lubaczewski wrote:
> This might be a bit different answer from what you expect, but have you
> seen pgl_ddl_deploy project?

Thanks --- I was unaware of this project so I will take a look.

However, we are operating under a limitation that the publisher is in a hosted provider, so we cannot install
extensionsunless they are "blessed"; hence looking for a solution that doesn't require that.
 

I did go and look at what pgaudit does WRT to this problem as I know that that extension can emit just the statement
beingexecuted.  I didn't fully understand all the detail, but did notice that it maintains a stack of statements for
thecurrent execution, presumably so it knows if the trigger has been called already, e.g. in the case of a DO block.
Thisindicates to me that I can't do what I would like in pure PLPGSQL triggers.
 

-Joe



pgsql-general by date:

Previous
From: hubert depesz lubaczewski
Date:
Subject: Re: Getting the exact SQL from inside an event trigger
Next
From: cen
Date:
Subject: Re: Postgres undeterministically uses a bad plan, how to convince it otherwise?