Re: Getting the exact SQL from inside an event trigger

Поиск
Список
Период
Сортировка
От Joe Wildish
Тема Re: Getting the exact SQL from inside an event trigger
Дата
Msg-id 27d484ae-98b0-44aa-8718-7fda1387b5b8@app.fastmail.com
обсуждение исходный текст
Ответ на Re: Getting the exact SQL from inside an event trigger  (hubert depesz lubaczewski <depesz@depesz.com>)
Список 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 по дате отправления:

Предыдущее
От: hubert depesz lubaczewski
Дата:
Сообщение: Re: Getting the exact SQL from inside an event trigger
Следующее
От: cen
Дата:
Сообщение: Re: Postgres undeterministically uses a bad plan, how to convince it otherwise?