Re: pre-commit triggers

From: Hannu Krosing <hannu(at)2ndQuadrant(dot)com>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pre-commit triggers
Date: 2013-11-16 20:00:57
Message-ID: 5287CEF9.3020908@2ndQuadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 11/15/2013 07:01 PM, Andrew Dunstan wrote:
>
> Attached is a patch to provide a new event trigger that will fire on
> transaction commit. I have tried to make certain that it fires at a
> sufficiently early stage in the commit process that some of the evils
> mentioned in previous discussions on this topic aren't relevant.
>
> The triggers don't fire if there is no real XID, so only actual data
> changes should cause the trigger to fire.
I have not looked at the patch, but does it also run pre-rollback ?

If not, how hard would it be to make it so ?

> They also don't fire in single user mode, so that if you do something
> stupid like create a trigger that unconditionally raises an error you
> have a way to recover.
>
> This is intended to be somewhat similar to the same feature in the
> Firebird database, and the initial demand came from a client migrating
> from that system to Postgres.
>
> cheers
>
> andrew
>
>

--
Hannu Krosing
PostgreSQL Consultant
Performance, Scalability and High Availability
2ndQuadrant Nordic OÜ

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Hannu Krosing 2013-11-16 20:04:21 Re: additional json functionality
Previous Message Fujii Masao 2013-11-16 19:25:23 Re: New option for pg_basebackup, to specify a different directory for pg_xlog