pre-commit triggers

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: pre-commit triggers
Date: 2013-11-15 18:01:48
Message-ID: 5286618C.60301@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


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. 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

Attachment Content-Type Size
txn-commit-triggers-1.patch text/x-patch 6.8 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2013-11-15 18:08:30 Re: Sequence Access Method WIP
Previous Message Peter Eisentraut 2013-11-15 17:56:29 Re: GIN improvements part 1: additional information