pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Joe Wildish <joe@lateraljoin.com>
To: pgsql-general@lists.postgresql.org
To: depesz@depesz.com
Subject: Re: Getting the exact SQL from inside an event trigger
Date: Thu, 02 Mar 2023 13:01:54 +0000
Message-ID: <27d484ae-98b0-44aa-8718-7fda1387b5b8@app.fastmail.com> (raw)
In-Reply-To: <ZACWjsvpaP7pZtc+@depesz.com>
References: <10164c95-ef23-4624-9251-ea6ff594cd1c@app.fastmail.com>
	<ZACWjsvpaP7pZtc+@depesz.com>

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 extensions unless 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 being executed.  I didn't fully understand all the detail, but did notice that it maintains a stack of statements for the current execution, presumably so it knows if the trigger has been called already, e.g. in the case of a DO block.  This indicates to me that I can't do what I would like in pure PLPGSQL triggers.

-Joe





view thread (3+ messages)

Message-ID: <27d484ae-98b0-44aa-8718-7fda1387b5b8@app.fastmail.com>
Permalink:  ../27d484ae-98b0-44aa-8718-7fda1387b5b8@app.fastmail.com/
Also on:    postgresql.org/message-id/27d484ae-98b0-44aa-8718-7fda1387b5b8@app.fastmail.com

 · 

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: joe@lateraljoin.com, depesz@depesz.com
  Subject: Re: Getting the exact SQL from inside an event trigger
  In-Reply-To: <27d484ae-98b0-44aa-8718-7fda1387b5b8@app.fastmail.com>
  References: <10164c95-ef23-4624-9251-ea6ff594cd1c@app.fastmail.com> <ZACWjsvpaP7pZtc+@depesz.com> <27d484ae-98b0-44aa-8718-7fda1387b5b8@app.fastmail.com>

* 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