Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id B4CA99F96FD for ; Mon, 20 Aug 2007 08:21:12 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 20659-03 for ; Mon, 20 Aug 2007 08:21:04 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from web31810.mail.mud.yahoo.com (web31810.mail.mud.yahoo.com [68.142.207.73]) by postgresql.org (Postfix) with SMTP id 28DD99F96E8 for ; Mon, 20 Aug 2007 08:21:08 -0300 (ADT) Received: (qmail 34610 invoked by uid 60001); 20 Aug 2007 11:21:06 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=2+e6c+wzcWZr86YLf/0pBICkj/nyOw6Tf7igbxj31glE9L8A8GWlu5IfAjC8gSz/ZUiGD2kfO8kGHFVZjmDHSDLHjSacKjvOEifw2Eqx3/uZFoXN/KdppeWVoyixfw3MHkZKXYU23TfSZH1M/2fb1Pu00yW86F2gzAVRJ5hC8Xk=; X-YMail-OSG: w6i7KgYVM1lHHGAUz8zi3.ClcexK7Rz2xoYSoOvkT9_17AZU6aZllwXyKWJnWPLHShXq5Zj5pINAjccSfzkPEzetM.WCmk3j5IR_CLtHs7YoCQ6VMtc- Received: from [75.84.89.248] by web31810.mail.mud.yahoo.com via HTTP; Mon, 20 Aug 2007 04:21:06 PDT Date: Mon, 20 Aug 2007 04:21:06 -0700 (PDT) From: Richard Broersma Jr Subject: Re: TRIGGERS and FUNCTIONS To: ashok raj , pgsql-sql@postgresql.org In-Reply-To: <399c75c20708192156i62567ce7obf933be20fed7ff@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Message-ID: <535186.34449.qm@web31810.mail.mud.yahoo.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200708/157 X-Sequence-Number: 29095 --- ashok raj wrote: > Hello All , > > I am having a table named "test" with a trigger " tri_test > " which triggers the function " replicate() " on insert, update and > delete . > Can I able to get the SQL STATEMENT which triggers the > function replicate ( ) , inside the function definition replicate ( ) . > So that I could execute that statement in the remote > postgreSQL server You probably can get the statement. However, your solution sounds a lot like an existing replication solution, "Slony". It will do exactly what you want, and is already stable for production systems. http://pgfoundry.org/projects/slony1/ Regards, Richard Broersma Jr.