Re: [SQL] rewriting values with before trigger

From: nolan(at)celery(dot)tssi(dot)com
To: gearond(at)cvc(dot)net
Cc: xzilla(at)users(dot)sourceforge(dot)net (Robert Treat), josh(at)agliodbs(dot)com (Josh Berkus), pgsql-general(at)postgresql(dot)org (pgsql-general(at)postgresql(dot)org), pgsql-sql(at)postgresql(dot)org
Subject: Re: [SQL] rewriting values with before trigger
Date: 2003-04-24 21:18:05
Message-ID: 20030424211805.22526.qmail@celery.tssi.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-sql

> 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Matthew Nuzum 2003-04-24 21:31:33 Re: [SQL] rewriting values with before trigger
Previous Message Dennis Gearon 2003-04-24 20:38:00 Re: pl-pgsql question

Browse pgsql-sql by date

  From Date Subject
Next Message Matthew Nuzum 2003-04-24 21:31:33 Re: [SQL] rewriting values with before trigger
Previous Message Dennis Gearon 2003-04-24 20:35:40 Re: [SQL] rewriting values with before trigger