WIP: deferred-trigger rewrite

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>, Jan Wieck <JanWieck(at)Yahoo(dot)com>
Cc: pgsql-patches(at)postgreSQL(dot)org
Subject: WIP: deferred-trigger rewrite
Date: 2004-09-10 04:10:09
Message-ID: 13932.1094789409@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Since this is a rather larger patch than we customarily apply during
beta, I thought I'd better circulate it for review before pushing it in.

It is not ready to apply yet because it lacks regression tests or doc
updates, and also I haven't yet done anything about the idea of saving
space by sharing information across many firings of the same trigger.
But it addresses the basic problem of firing AFTER triggers at the
"right times" within functions. And I think it offers a reasonable
approach to the issues Stephan raised about what happens when a trigger
function mucks with the firing order by executing SET CONSTRAINTS.
In this implementation, any particular query determines the set of
pending triggers it will fire before any of them are actually executed.
A SET CONSTRAINTS within one of those triggers cannot alter the
scheduling of any already-scheduled-to-fire trigger, but it can enable
and execute triggers that the outer query has determined it will not
fire.

I also took the liberty of renaming structs and functions in the
interests of clarity. In particular, all the "DeferredTrigger" stuff is
now "AfterTrigger" stuff, since it actually handles all AFTER triggers
whether they are "deferred" in the spec's sense or not.

Comments, objections, better ideas? I hope to commit this in the next
couple days.

regards, tom lane

Attachment Content-Type Size
trigger.patch.gz application/octet-stream 17.8 KB

Browse pgsql-patches by date

  From Date Subject
Next Message Neil Conway 2004-09-10 04:15:39 Re: Minor psql consistency fixes
Previous Message Bruce Momjian 2004-09-10 03:27:37 Re: psql tab-completion improvements