pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Joshua Tolley <eggyknap@gmail.com>
To: Adam Ruth <adamruth@mac.com>
Cc: Pawel Socha <pawel.socha@gmail.com>
Cc: Nicholas I <nicholas.domnic.i@gmail.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Comparing two tables of different database
Date: Wed, 29 Apr 2009 21:37:48 -0600
Message-ID: <20090430033747.GB1126@eddie> (raw)
In-Reply-To: <328DDBBB-31C4-41D7-BF0E-5ADD732F2B9F@mac.com>
References: <e13d0d10904282339r1f853e1cpe3514e53ae47e5ef@mail.gmail.com>
	<cc4f12900904290533x5e1871fdu8f8a27dc956ca616@mail.gmail.com>
	<328DDBBB-31C4-41D7-BF0E-5ADD732F2B9F@mac.com>

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 (<query>) TO <file>, where <query> includes an
ORDER BY clause, might give you a suitable result from both tables, on
which you could then take a checksum.

- Josh / eggyknap

Attachments:

  signature.asc (application/pgp-signature, 196B) download

view thread (18+ messages)  latest in thread

Message-ID: <20090430033747.GB1126@eddie>
Permalink:  ../20090430033747.GB1126@eddie/
Also on:    postgresql.org/message-id/20090430033747.GB1126@eddie

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: eggyknap@gmail.com, adamruth@mac.com, pawel.socha@gmail.com, nicholas.domnic.i@gmail.com
  Subject: Re: Comparing two tables of different database
  In-Reply-To: <20090430033747.GB1126@eddie>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox