Our runtime deployment of database servers (7.4) involves some redundant/duplicate databases. In order to compare tables (about 5 gigs each) on different servers I unload the things (takes a while etc.), sort them with a UNIX sort and then do a cksum on them.
Is there any way to do this from inside postgres that anyone knows of ? I looked through the manual and the contrib stuff and didn't see much ...
Thanks,
Greg Williamson
DBA
GlobeXplorer LLC
---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?
---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster
Not really "inside postgres"; but could you do something like:
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
That should work with most shells under Unix. . .
Have fun,
Sam
---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend
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/