In case dblink was not installed, you could try the following:
1. dump only the data from the table from database 1
pg_dump -U username -a -d -t tablename dbname > tablename.sql
2. create a (temp) table in database 2
SELECT * INTO tablename_bak from tablename WHERE 1 = 2
3. restore the dumped data in the bak table in database 2
pg_restore -U username -a -t tablename_bak dbname tablename.sql
4.select * from tablename except select * from tablename_bak
or you could dump the data from both tables and use some kind of diff tool
Nicholas I wrote:
> Hi,
>
> can anybody me suggest me, how to compare two tables of different
> database.
>
> -Nicholas I