X-Original-To: pgsql-sql-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 2C0409FA226 for ; Mon, 26 Jun 2006 12:38:29 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 22087-07 for ; Mon, 26 Jun 2006 12:38:15 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from exchange.g2switchworks.com (mail.g2switchworks.com [63.87.162.25]) by postgresql.org (Postfix) with ESMTP id 24F049F9AD3 for ; Mon, 26 Jun 2006 12:38:13 -0300 (ADT) Received: from 10.10.1.37 ([10.10.1.37]) by exchange.g2switchworks.com ([10.10.1.2]) with Microsoft Exchange Server HTTP-DAV ; Mon, 26 Jun 2006 15:38:06 +0000 Received: from state.g2switchworks.com by mail.g2switchworks.com; 26 Jun 2006 10:38:06 -0500 Subject: Re: Fwd: Start up question about triggers From: Scott Marlowe To: "Forums @ Existanze" Cc: pgsql-sql@postgresql.org In-Reply-To: <200606261359.k5QDxE2p004593@auth-smtp.hol.gr> References: <200606261359.k5QDxE2p004593@auth-smtp.hol.gr> Content-Type: text/plain Content-Transfer-Encoding: 7bit Message-Id: <1151336286.4215.35.camel@state.g2switchworks.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 (1.4.6-2) Date: Mon, 26 Jun 2006 10:38:06 -0500 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200606/268 X-Sequence-Number: 25504 On Mon, 2006-06-26 at 08:59, Forums @ Existanze wrote: > Hello again, > > The problem is not tracking WHAT changed, this can be done, as we have > discussed in this thread, the problem is how to replicate the necessary > commands that will alter a mirror database to reflect what has been changed, > sequencially and in the order that it has occurred. > > I you can find my first question (I can repost), you will see that this > problem has arisen due of lack of proper design. This is a requirement that > has just come into the picture and we have to find a solution for it. > > My initial question was intended to figure out a way to track these changes > AND create the necessary INSERT,DELETE and UPDATE statements for each of the > changes that occurr in the entire database. I wanted to avoid having to > create an audit table for each of the tables in the database. At the moment > we are counting 82, this will mean another 82 tables, along with 82 triggers > and so on. I'm having a mad scientist moment. I bet it would be possible to hack pgpool to do this. Just have it shoot all the queries that come in to it at the normal database, AND at a text file or something like that. Not sure that's any better than using pgsql logging to do the same thing, but it certainly doesn't seem like it would be that hard to do.