Re: Comparing tables in different db's

From: Darren Johnson <djohnson(at)greatbridge(dot)com>
To: Phillip F Jansen <pfj(at)ucs(dot)co(dot)za>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Comparing tables in different db's
Date: 2001-08-10 13:39:56
Message-ID: 20010810.13395600@j2.us.greatbridge.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

>>>>>>>>>>>>>>>>>> Original Message <<<<<<<<<<<<<<<<<<

> I would like to know if there is a way to compare the data of tables in
> different databases. For example I have table in db1 and exactly the
> same table in db2. Is it possible to see if the contents of the two
> tables are exactly the same?

I use pg_dump for my tests. Example

pg_dump -a -t table_name db1 > db1_dump.out
pg_dump -a -t table_name db2 > db2_dump.out

Then you can use diff db1_dump.out db2_dump.out

I hope this helps

Darren

> For example if the table(db1.customer) has a column surname and the
> field has a value of "Testing" and in db2.customer the exact same row
> has a value "Testong" is it possible to actually know that there is a
> difference ? I don't actually have to know what the actual differences
> are , I must just know that there is a difference.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2001-08-10 13:54:46 Re: PL/pgSQL bug?
Previous Message Jan Wieck 2001-08-10 12:38:24 Re: PL/pgSQL bug?