X-Original-To: pgsql-general@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id F3331475B85 for ; Thu, 24 Apr 2003 17:18:05 -0400 (EDT) Received: from celery.tssi.com (celery.tssi.com [198.147.197.6]) by postgresql.org (Postfix) with SMTP id E97C1475458 for ; Thu, 24 Apr 2003 17:18:04 -0400 (EDT) Received: (qmail 22527 invoked by uid 1000); 24 Apr 2003 21:18:05 -0000 Message-ID: <20030424211805.22526.qmail@celery.tssi.com> From: nolan@celery.tssi.com Subject: Re: [SQL] rewriting values with before trigger To: gearond@cvc.net Date: Thu, 24 Apr 2003 16:18:05 -0500 (CDT) Cc: xzilla@users.sourceforge.net (Robert Treat), josh@agliodbs.com (Josh Berkus), pgsql-general@postgresql.org (pgsql-general@postgresql.org), pgsql-sql@postgresql.org In-Reply-To: <3EA836AF.8060704@cvc.net> from "Dennis Gearon" at Apr 24, 2003 12:10:39 PM X-Mailer: ELM [version 2.5 PL3] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Status: No, hits=-11.2 required=5.0 tests=BAYES_10,IN_REP_TO,NO_REAL_NAME,QUOTED_EMAIL_TEXT version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200304/1280 X-Sequence-Number: 41345 > 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