Re: Comparing two tables of different database

Поиск
Список
Период
Сортировка
От M.P.Dankoor
Тема Re: Comparing two tables of different database
Дата
Msg-id 49FC1D89.2070007@gmail.com
обсуждение исходный текст
Ответ на Comparing two tables of different database  (Nicholas I <nicholas.domnic.i@gmail.com>)
Список pgsql-sql
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



В списке pgsql-sql по дате отправления:

Предыдущее
От: Wei Weng
Дата:
Сообщение: Re: Comparing two tables of different database
Следующее
От: Lucas Brito
Дата:
Сообщение: Re: Comparing two tables of different database