Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 6FE0E47672D for ; Thu, 26 Sep 2002 04:14:56 -0400 (EDT) Received: from mail-relay.trade-india.com (mail-relay.trade-india.com [203.196.129.235]) by postgresql.org (Postfix) with SMTP id C4614476353 for ; Thu, 26 Sep 2002 04:14:51 -0400 (EDT) Received: (qmail 16456 invoked from network); 26 Sep 2002 08:05:23 -0000 Received: from system67.trade-india-local.com (192.168.0.67) by infocom-236-129-del.trade-india.com with SMTP; 26 Sep 2002 08:05:23 -0000 Content-Type: text/plain; charset="iso-8859-1" From: "Rajesh Kumar Mallah." Organization: Infocom Network Limited. To: Steven Singer Subject: Re: [DBmirror Issue] recordchange() dies in packageData unless there is a PRIMARY KEY on DELETE and UPDATEs. Date: Thu, 26 Sep 2002 13:48:28 +0530 User-Agent: KMail/1.4.1 Cc: , References: In-Reply-To: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200209261348.28221.mallah@trade-india.com> X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200209/274 X-Sequence-Number: 5813 Hi Steven, Your most recent version pending.c does not crashes postmaster anymore when PRIMARY KEYS are missing. Instead it raises notices and errors: tradein_clients=3D> BEGIN work; UPDATE iid_listing set city=3D'DELHI testin= g' where list_id=3D23312; BEGIN NOTICE: Could not select primary index key NOTICE: Error obtaining primary key values ERROR: Operation could not be mirrored Regds Mallah. On Tuesday 24 September 2002 02:18, Steven Singer wrote: > On Mon, 23 Sep 2002, Rajesh Kumar Mallah. wrote: > > Hi > > > > Is anyone using dbmirror in production? > > We've been using it in production for sometime now and haven't been having > any problems with it. > > > I Intend to replicate a set of tables between local and remote servers. > > and plan to use dbmirror. > > The speed of replicating edits over a WAN isn't that great. > If you perform a lot of edits in a short period of time there could be a > backlog. > > > I observe that unless a table has a primary key the trigger > > recordchange() which is supposed to be attached to a replicated table > > does not works properly and causes postmaster to crash. > > dbmirror requires that all tables that you replicate have primary > keys(This should be said more explictly in the README) > > However it still should not crash(In defence it will only crash the > postmaster when you compile dbmirror in debug mode). > > The attatched patch to pending.c should prevent it from crashing the > postmaster. Let me know if it fixes the problem and I'll submit it to > pgpatches. > > > *** pending.c Mon Sep 23 20:24:04 2002 > --- /tmp/pending.c Mon Sep 23 20:23:43 2002 > *************** > *** 226,232 **** > /* pplan =3D SPI_saveplan(pplan); */ > cpKeyData =3D packageData(tTupleData, tTupleDesc, tpTrigData, > PRIMARY); > #if defined DEBUG_OUTPUT > ! elog(NOTICE, cpKeyData); > #endif > saPlanData[0] =3D PointerGetDatum(cpKeyData); > > --- 226,235 ---- > /* pplan =3D SPI_saveplan(pplan); */ > cpKeyData =3D packageData(tTupleData, tTupleDesc, tpTrigData, > PRIMARY); > #if defined DEBUG_OUTPUT > ! if(cpKeyData !=3D NULL ) > ! { > ! elog(NOTICE, cpKeyData); > ! } > #endif > saPlanData[0] =3D PointerGetDatum(cpKeyData); --=20 Rajesh Kumar Mallah, Project Manager (Development) Infocom Network Limited, New Delhi phone: +91(11)6152172 (221) (L) ,9811255597 (M) Visit http://www.trade-india.com , India's Leading B2B eMarketplace.