pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Erik Wienhold <ewie@ewie.name>
To: Marc Millas <marc.millas@mokadb.com>
To: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re: event trigger clarification
Date: Wed, 30 Aug 2023 18:18:51 +0200 (CEST)
Message-ID: <1721713174.17585.1693412331169@office.mailbox.org> (raw)
In-Reply-To: <CADX_1abcz0j2odqGjSxfRcbmu21cH6QwzKZFqq0mOJrLGEx55g@mail.gmail.com>
References: <CADX_1abcz0j2odqGjSxfRcbmu21cH6QwzKZFqq0mOJrLGEx55g@mail.gmail.com>

> On 30/08/2023 17:12 CEST Marc Millas <marc.millas@mokadb.com> wrote:
>
> the doc v15 states: " pg_event_trigger_ddl_commands returns a list of DDL
> commands executed by each user action, when invoked in a function attached
> to a ddl_command_end event trigger."
> When some ddl command is executed within a block, I would like to know if the
> event trigger fires when the line is executed or at commit time.

The event trigger fires just before[1]/after[2] executing a complete command.
So not at commit time.

[1] https://git.postgresql.org/gitweb/?p=postgresql.git;a=blob;f=src/backend/tcop/utility.c;h=6b0a865262...
[2] https://git.postgresql.org/gitweb/?p=postgresql.git;a=blob;f=src/backend/tcop/utility.c;h=6b0a865262...

--
Erik





view thread (5+ messages)  latest in thread

Message-ID: <1721713174.17585.1693412331169@office.mailbox.org>
Permalink:  ../1721713174.17585.1693412331169@office.mailbox.org/
Also on:    postgresql.org/message-id/1721713174.17585.1693412331169@office.mailbox.org

 · 

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: ewie@ewie.name, marc.millas@mokadb.com
  Subject: Re: event trigger clarification
  In-Reply-To: <1721713174.17585.1693412331169@office.mailbox.org>
  References: <CADX_1abcz0j2odqGjSxfRcbmu21cH6QwzKZFqq0mOJrLGEx55g@mail.gmail.com> <1721713174.17585.1693412331169@office.mailbox.org>

* 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