Re: Triggers on transaction?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Simon Riggs <simon(at)2ndQuadrant(dot)com>
Cc: Jordan Gigov <coladict(at)gmail(dot)com>, Marko Tiikkaja <marko(at)joh(dot)to>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Triggers on transaction?
Date: 2015-05-27 14:14:47
Message-ID: 31402.1432736087@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Simon Riggs <simon(at)2ndQuadrant(dot)com> writes:
> Can't you just use deferred triggers?

That seems like the real $64 question.

> I'm not clear exactly when such a trigger should run. If the trigger issues
> more SQL, which also has triggers... do we run the PreCommit trigger twice?
> Or just accept that we wanted it to run just prior to commit but it kinda
> didn't?

Yeah. By the time you get rid of the logical inconsistencies in the
concept of a trigger that runs "at commit", it seems like you end up with
something not so different from the existing deferred-trigger facility.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2015-05-27 14:30:09 Re: Re: [COMMITTERS] pgsql: Add support for INSERT ... ON CONFLICT DO NOTHING/UPDATE.
Previous Message Alvaro Herrera 2015-05-27 14:06:24 Re: Re: [COMMITTERS] pgsql: Add support for INSERT ... ON CONFLICT DO NOTHING/UPDATE.