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 47F81D1B56B for ; Mon, 1 Sep 2003 20:36:00 +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 75967-06 for ; Mon, 1 Sep 2003 17:35:31 -0300 (ADT) Received: from web12705.mail.yahoo.com (web12705.mail.yahoo.com [216.136.173.242]) by svr1.postgresql.org (Postfix) with SMTP id D903CD1B897 for ; Mon, 1 Sep 2003 17:35:28 -0300 (ADT) Message-ID: <20030901203530.67332.qmail@web12705.mail.yahoo.com> Received: from [68.35.161.250] by web12705.mail.yahoo.com via HTTP; Mon, 01 Sep 2003 13:35:30 PDT Date: Mon, 1 Sep 2003 13:35:30 -0700 (PDT) From: chester c young Subject: Re: disabling triggers To: weigelt@metux.de, pgsql-sql@postgresql.org In-Reply-To: <20030901175704.GA12947@metux.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/3 X-Sequence-Number: 14981 --- weigelt@metux.de wrote: > On Tue, Jun 17, 2003 at 11:49:44AM -0700, Josh Berkus wrote: > > > > I also need something like that for my replication stuff: > > When data from another node comes it, it should be written > directly to the tables, without any (unwanted) triggers firering. > > On the other hand, in "normal" mode, also some missing fields > should be filled on create or update. > I have done this three ways: 1. have all client DML go through views and at the view level do all checking etc. + very robust, very secure - lots of work 2. have replication updates use the "replicate" user - in triggers, do nothing if user is replicate, otherwise work as normal + very easy to do - triggers fire always, even when doing nothing 3. have replicate triggers write data file for import directly into the postgresql engine + transactions smaller, less rollback + can replicate to different databases, over net, etc - lots of work (although easy to write trigger generator) - difficult failure senarios __________________________________ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com