Re: Clarify how triggers relate to transactions

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: him(at)nathanmlong(dot)com, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Clarify how triggers relate to transactions
Date: 2021-05-20 15:53:40
Message-ID: 4ca26d9c2e7ce620236dd69f3eb746fc2dbcafb4.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs pgsql-hackers

On Wed, 2021-05-05 at 11:55 +0200, Laurenz Albe wrote:
> On Wed, 2021-04-28 at 13:24 +0200, Laurenz Albe wrote:
> > On Tue, 2021-04-27 at 14:26 +0000, PG Doc comments form wrote:
> > > https://www.postgresql.org/docs/current/sql-createtrigger.html mentions the
> > > word "transaction" only once, in reference specifically to constraint
> > > triggers: "They can be fired either at the end of the statement causing the
> > > triggering event, or at the end of the containing transaction; in the latter
> > > case they are said to be deferred."
> > >
> > > If I understand correctly, it would be helpful to add this sentence or a
> > > corrected version of it: "Triggers always execute in the same transaction as
> > > the triggering event, and if a trigger fails, the transaction is rolled
> > > back."
> >
> > Good idea in principle, but I'd put that information on
> > https://www.postgresql.org/docs/current/trigger-definition.html
>
> Here is a proposed patch for this.

Replying to -hackers for the commitfest app.

Yours,
Laurenz Albe

In response to

Browse pgsql-docs by date

  From Date Subject
Next Message Tom Lane 2021-05-20 16:03:43 Re: pg_monitor role description
Previous Message Laurenz Albe 2021-05-20 15:52:38 Re: Update maintenance_work_mem/autovacuum_work_mem to reflect the 1GB limitation with VACUUM

Browse pgsql-hackers by date

  From Date Subject
Next Message vignesh C 2021-05-20 16:04:47 Re: Added missing tab completion for alter subscription set option
Previous Message Laurenz Albe 2021-05-20 15:52:38 Re: Update maintenance_work_mem/autovacuum_work_mem to reflect the 1GB limitation with VACUUM