Re: Odd(?) RI-trigger behavior

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: Odd(?) RI-trigger behavior
Date: 2002-04-19 03:43:54
Message-ID: 20020418204254.W96771-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

On Thu, 18 Apr 2002, Tom Lane wrote:

> Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com> writes:
> > Didn't someone (Peter?) say that the mandated firing order was based on
> > creation order/time in SQL99?
>
> It does say that:
>
> The order of execution of a set of triggers is ascending by value
> of their timestamp of creation in their descriptors, such that the
> oldest trigger executes first. If one or more triggers have the
> same timestamp value, then their relative order of execution is
> implementation-defined.
>
> However, this strikes me as fairly brain-dead; it's unnecessarily hard
> to control the order of trigger execution. You have to drop and
> recreate triggers if you want to insert a new one at a desired position.
> Worse, if you create several triggers in the same transaction, they'll
> have the same timestamp --- leaving you right back in the
> implementation-defined case. But if you want to make your rearrangement
> atomically with respect to other transactions, you have little choice
> but to drop/recreate in one xact. Looks like a catch-22 to me.
>
> ISTM we had discussed this before and concluded that name order was
> a more reasonable definition. Nobody had got round to doing anything
> about it though. (Indeed my current hack was not intended to provide
> a predictable firing order, it just fell out that way...)

I agree that name is better, I wasn't sure if we'd reached a consensus on
it or if the conversation drifted away due to the fact that noone was
looking at it at the time.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Joe Conway 2002-04-19 04:49:44 Re: Schema (namespace) privilege details
Previous Message Tom Lane 2002-04-19 03:30:26 Re: Odd(?) RI-trigger behavior

Browse pgsql-patches by date

  From Date Subject
Next Message Alvaro Herrera 2002-04-19 05:00:52 Re: Odd(?) RI-trigger behavior
Previous Message Tom Lane 2002-04-19 03:30:26 Re: Odd(?) RI-trigger behavior