X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 3E651D1B56C for ; Wed, 13 Aug 2003 17:21:42 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 48158-04 for ; Wed, 13 Aug 2003 14:20:06 -0300 (ADT) Received: from mail.deltav.hu (oldmail.deltav.hu [213.163.0.192]) by svr1.postgresql.org (Postfix) with ESMTP id 1337DD1B56B for ; Wed, 13 Aug 2003 14:21:31 -0300 (ADT) Received: from fejleszt4 ([213.163.10.103]) by mail.deltav.hu (Netscape Messaging Server 3.6) with SMTP id AAA30C7 for ; Wed, 13 Aug 2003 19:21:29 +0200 Message-ID: <005a01c361bf$3a1a5d40$0403a8c0@fejleszt4> From: "=?iso-8859-2?B?U1rbQ1MgR+Fib3I=?=" To: References: <001001c36183$4f636570$0403a8c0@fejleszt4> <200308130754.32211.jgardner@jonathangardner.net> <003e01c361b1$37d02780$0403a8c0@fejleszt4> <200308130920.07619.jgardner@jonathangardner.net> Subject: Re: Order of triggers - totally lost Date: Wed, 13 Aug 2003 19:20:43 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-2" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/147 X-Sequence-Number: 14763 Dear Jonathan, thanks for your POV. ----- Original Message ----- From: "Jonathan Gardner" Sent: Wednesday, August 13, 2003 6:20 PM > I try to avoid triggers unless it is completely obvious what they are > doing and why I should use them. This tends to minimize the number of > them hanging around. I am a programmer - python, perl mostly - so the > logic flow of triggers isn't something I can keep a firm handle on all > the time. We prefer using triggers to protect the server as well as client logic and even wizards (some of them have more than 100 graph vertices and edges) to help the users avoid illegal operations. In short: double protection. > My tables only end up with a couple of triggers, if any. I have a ton of A couple of triggers for most tables, yes. But for over 100 tables, this is a couple hundred triggers total. Is that what you meant? > stored procedures lying around, however -- pretty much one for each > "action" a user would take to modify the database. If a trigger > triggers another trigger, they aren't dependant on the order thereof, > or even the existance of the other trigger. > > You may also want to examine PostgreSQL's RULE system (CREATE RULE). I > think some of your triggers may be interchangeable with rules. You have a point there... not sure I'll have the time to experiment (we are ordered to make only small changes to be easily commitable to the in-production version) G. ------------------------------- cut here -------------------------------