Re: pre-commit triggers

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Noah Misch <noah(at)leadboat(dot)com>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pre-commit triggers
Date: 2013-11-19 16:46:10
Message-ID: CA+Tgmobxo5xyvOagRwWp2+=K1ubbH7TAf+tP3Ra6WLJR5H-Onw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Nov 19, 2013 at 12:45 AM, Noah Misch <noah(at)leadboat(dot)com> wrote:
> On Fri, Nov 15, 2013 at 01:01:48PM -0500, Andrew Dunstan wrote:
>> The triggers don't fire if there is no real XID, so only actual data
>> changes should cause the trigger to fire.
>
> What's the advantage of this provision? Without it, an individual trigger
> could make the same check and drop out quickly. A trigger not wanting it
> can't so easily work around its presence, though. Heretofore, skipping XID
> assignment has been an implementation detail that improves performance without
> otherwise calling user attention to itself. This provision would make the
> decision to acquire an XID (where optional) affect application behavior.

Yeah, I agree that that's an ugly wart. If we want a pre-commit
trigger that's only called for transactions that write data, we at
least need to name it appropriately.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Sawada Masahiko 2013-11-19 16:48:52 Re: Logging WAL when updating hintbit
Previous Message Pavel Stehule 2013-11-19 16:46:02 Re: Assertions in PL/PgSQL