From: Michael Fuhr <mike@fuhr.org>
To: pgsql-sql@postgresql.org
Subject: Re: Comparing two (largish) tables on different servers
Date: Wed, 10 Nov 2004 12:32:50 -0700
Message-ID: <20041110193250.GA18174@winnie.fuhr.org> (raw)
In-Reply-To: <20041110091821.GD25775@sam.samason.me.uk>
References: <71E37EF6B7DCC1499CEA0316A256832801D4BAB0@loki.wc.globexplorer.net>
<20041110091821.GD25775@sam.samason.me.uk>
On Wed, Nov 10, 2004 at 09:18:21AM +0000, Sam Mason wrote:
>
> mkfifo db1
> psql -h "db1" -t -q -c "$query" > db1
> mkfifo db2
> psql -h "db2" -t -q -c "$query" > db2
> diff -u -0 db1 db2
This should work for small data sets, but the OP said the tables
were about 5G. Unless you use a cursor, psql will fetch the entire
result before writing anything. Also, some implementations of diff
might read all of the data from one file before reading much from
the other file, especially if the files have differences. Hope
you have lots of memory....
--
Michael Fuhr
http://www.fuhr.org/~mfuhr/
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: mike@fuhr.org
Subject: Re: Comparing two (largish) tables on different servers
In-Reply-To: <20041110193250.GA18174@winnie.fuhr.org>
* 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