Re: [SQL] rewriting values with before trigger - Mailing list pgsql-general

From nolan@celery.tssi.com
Subject Re: [SQL] rewriting values with before trigger
Date
Msg-id 20030424211805.22526.qmail@celery.tssi.com
Whole thread Raw
In response to Re: [SQL] rewriting values with before trigger  (Dennis Gearon <gearond@cvc.net>)
List pgsql-general
> OR, deliberately name your triggers with alphanumerical prefixes that
> forces them to fire in a certain order, and making the trigger that
> does the conversion fire first?

The SQL 99 standard mandates that triggers fire the order defined, though
the docs say pgsql does it in alphabetical order, possibly because that
was easier to implement.

It is probably better to assume that in any given situation they will fire
in a random order and sequence events yourself when necessary.

That may mean throwing the '' into NULL logic into every trigger for that
table, though there are probably more elegant ways to achieve that result.

If God (or Codd?) had meant us to enable triggers to fire in a particular
order, there would be a 'firing order nnnn' sequencing parameter in the
standard.

--
Mike Nolan


pgsql-general by date:

Previous
From: Dennis Gearon
Date:
Subject: Re: pl-pgsql question
Next
From: "Matthew Nuzum"
Date:
Subject: Re: [SQL] rewriting values with before trigger