Re: Comparing tables in different db's - Mailing list pgsql-hackers

From Darren Johnson
Subject Re: Comparing tables in different db's
Date
Msg-id 20010810.13395600@j2.us.greatbridge.com
Whole thread Raw
In response to Comparing tables in different db's  (Phillip F Jansen <pfj@ucs.co.za>)
List 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.




pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: PL/pgSQL bug?
Next
From: Tom Lane
Date:
Subject: Re: PL/pgSQL bug?