pre-commit triggers - Mailing list pgsql-hackers

From Andrew Dunstan
Subject pre-commit triggers
Date
Msg-id 5286618C.60301@dunslane.net
Whole thread Raw
Responses Re: pre-commit triggers  (Peter Eisentraut <peter_e@gmx.net>)
Re: pre-commit triggers  (Hannu Krosing <hannu@2ndQuadrant.com>)
Re: pre-commit triggers  (Noah Misch <noah@leadboat.com>)
Re: pre-commit triggers  (Andres Freund <andres@2ndquadrant.com>)
List 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

pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: GIN improvements part 1: additional information
Next
From: Heikki Linnakangas
Date:
Subject: Re: Sequence Access Method WIP