X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 03B013A4049 for ; Wed, 10 Nov 2004 00:11:30 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 26363-05 for ; Wed, 10 Nov 2004 00:11:26 +0000 (GMT) Received: from boutiquenumerique.com (boutiquenumerique.com [82.67.9.10]) by svr1.postgresql.org (Postfix) with ESMTP id E9A903A4038 for ; Wed, 10 Nov 2004 00:11:23 +0000 (GMT) Received: (qmail 7633 invoked from network); 10 Nov 2004 01:11:40 +0100 Received: from unknown (HELO musicbox) (boutiquenumerique-lists@192.168.0.2) by boutiquenumerique.com with SMTP; 10 Nov 2004 01:11:40 +0100 To: pgsql-sql@postgresql.org Subject: Re: Comparing two (largish) tables on different servers References: <71E37EF6B7DCC1499CEA0316A256832801D4BAB0@loki.wc.globexplorer.net> Message-ID: Date: Wed, 10 Nov 2004 01:12:08 +0100 From: =?iso-8859-15?Q?Pierre-Fr=E9d=E9ric_Caillaud?= Organization: =?iso-8859-15?Q?La_Boutique_Num=E9rique?= Content-Type: text/plain; format=flowed; delsp=yes; charset=iso-8859-15 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit In-Reply-To: <71E37EF6B7DCC1499CEA0316A256832801D4BAB0@loki.wc.globexplorer.net> User-Agent: Opera M2/7.54 (Linux, build 751) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200411/91 X-Sequence-Number: 19410 Idea : Write a program which connects on the two databases, creates a cursor on each to return the rows in order, then compare them as they come (row 1 from cursor 1 == row 1 from cursor 2, etc). Fetch in batchs. If there's a difference you can then know which row. I hope you have an index to sort on, to save you a huge disk sort. On Tue, 9 Nov 2004 14:41:00 -0800, Gregory S. Williamson wrote: > This is probably a silly question. > > Our runtime deployment of database servers (7.4) involves some > redundant/duplicate databases. In order to compare tables (about 5 gigs > each) on different servers I unload the things (takes a while etc.), > sort them with a UNIX sort and then do a cksum on them. > > Is there any way to do this from inside postgres that anyone knows of ? > I looked through the manual and the contrib stuff and didn't see much ... > > Thanks, > > Greg Williamson > DBA > GlobeXplorer LLC > > ---------------------------(end of broadcast)--------------------------- > TIP 5: Have you checked our extensive FAQ? > > http://www.postgresql.org/docs/faqs/FAQ.html >