Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 12D7E63EA17 for ; Thu, 30 Apr 2009 18:59:05 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 87498-02-7 for ; Thu, 30 Apr 2009 18:58:54 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.231]) by mail.postgresql.org (Postfix) with ESMTP id 74A6664073D for ; Thu, 30 Apr 2009 00:37:58 -0300 (ADT) Received: by rv-out-0506.google.com with SMTP id k40so1288694rvb.43 for ; Wed, 29 Apr 2009 20:37:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:references:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=t3tWafmWNQVOpJU+GVpvX/daeuIbdvYREfqlYci+xBE=; b=CxCoy9ymtT4FS5g04u4aGEjxK1ekHm9exhhjy9zWlh//HeZFrAv2tco3Oc4fwtcrm3 x5+/6x2GuvCfumEl7Ux2+o8mXsveUbSvS5d/p+RSob2ns0pS1Pzu801hqB5wfOmVJ7Iy tKO9X8+7hOWRrlXkxDYjb0B/3RuS6uviGKLzk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=os5n4KhqOOS1wr4zb+WoNOX23gH3RxfqXpA864GzFxCLRgBIBjrgoBj881nw/vh9M3 Z/c4kxax/CAF31zAoZEmyQXl2ps3kkR4S/xK0xZmSvmOD+wAeRCWPxuvJqRIBMvd/duj 5/ic5gVn5TOfbKM2DmSX+6YXF9NlLk8Vcju7E= Received: by 10.141.97.5 with SMTP id z5mr348078rvl.214.1241062677437; Wed, 29 Apr 2009 20:37:57 -0700 (PDT) Received: from eddie ([67.186.240.209]) by mx.google.com with ESMTPS id f21sm3805523rvb.25.2009.04.29.20.37.55 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 29 Apr 2009 20:37:56 -0700 (PDT) Date: Wed, 29 Apr 2009 21:37:48 -0600 From: Joshua Tolley To: Adam Ruth Cc: Pawel Socha , Nicholas I , pgsql-sql@postgresql.org Subject: Re: Comparing two tables of different database Message-ID: <20090430033747.GB1126@eddie> References: <328DDBBB-31C4-41D7-BF0E-5ADD732F2B9F@mac.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="61jdw2sOBCFtR2d/" Content-Disposition: inline In-Reply-To: <328DDBBB-31C4-41D7-BF0E-5ADD732F2B9F@mac.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200904/143 X-Sequence-Number: 32489 --61jdw2sOBCFtR2d/ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Apr 30, 2009 at 08:20:02AM +1000, Adam Ruth wrote: > The simple answer is to pg_dump both tables and compare the output with > diff. > Other than that, I think you'll need a custom program. For all but the strictest definition of "identical", that won't work. Tables may easily contain the same information, in different on-disk order, and pg_dump will most likely give the data to you in an order similar to its ordering on disk. Something like a COPY () TO , where includes an ORDER BY clause, might give you a suitable result from both tables, on which you could then take a checksum. - Josh / eggyknap --61jdw2sOBCFtR2d/ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEARECAAYFAkn5HQoACgkQRiRfCGf1UMPcagCfQDRa2bXPRjgSuVsrFYTnGTTC rhoAnAlGwp0vSKd2uspyFvxCTfugG6Yh =LO6r -----END PGP SIGNATURE----- --61jdw2sOBCFtR2d/--