X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id F079D9DC849 for ; Sat, 17 Dec 2005 07:28:59 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 68062-09 for ; Sat, 17 Dec 2005 07:28:59 -0400 (AST) Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) by postgresql.org (Postfix) with ESMTP id 130589DCDB4 for ; Sat, 17 Dec 2005 07:28:55 -0400 (AST) Received: from erasmus.terena.nl (erasmus.terena.nl [192.87.30.2]) by svr4.postgresql.org (Postfix) with ESMTP id 383145AF081 for ; Sat, 17 Dec 2005 11:28:57 +0000 (GMT) Received: from localhost (erasmus [127.0.0.1]) by erasmus.terena.nl (Postfix) with ESMTP id DD12064631 for ; Sat, 17 Dec 2005 12:28:55 +0100 (CET) Received: from erasmus.terena.nl ([127.0.0.1]) by localhost (erasmus [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 11855-02 for ; Sat, 17 Dec 2005 12:28:55 +0100 (CET) Received: from [IPv6?2001?610?148?beef?6101?6c87?dd83?925c] (unknown [IPv6:2001:610:148:beef:6101:6c87:dd83:925c]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by erasmus.terena.nl (Postfix) with ESMTP id 0FBE46454F for ; Sat, 17 Dec 2005 12:28:55 +0100 (CET) Message-ID: <43A3F676.5000109@tienhuis.nl> Date: Sat, 17 Dec 2005 12:28:54 +0100 From: Dick Visser User-Agent: Thunderbird 1.5 (Windows/20051025) MIME-Version: 1.0 To: pgsql-admin@postgresql.org Subject: binary vs. txt dumps with pg Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at erasmus.terena.nl X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0 required=5 tests=[none] X-Spam-Score: 0 X-Spam-Level: X-Archive-Number: 200512/180 X-Sequence-Number: 19900 Hi all This is my first post to the pgsal-admin list. I am doing IT support for a small company, and we have been running PG for a few years now. I have recently upgraded our PG-8.0.3 server to 8.1.0. Everything went OK, and now I am working on the backup schema. I seems that since 8.1 pg_dump does not include a switch to dump blobs anymore. As a consequence, it is now also possible to dump db's with blobs in txt format. This is great, only the dumps become rather large because the blobs have to be escaped etc etc. Since I use rysnc to a remote host for backups, I have created a script hat dumps each db to a file, and then checks if the dump from yesterday is different. If not, the new dump is deleted and the old dump stays in place. This means a significant smaller backup, since most of our db's are pretty big but do not change that much. I have been fiddling with all kinds of techniques to accomplish this. The only way that seems to work is to make txt based dumps, and strip out all the comments and empty lines: pg_dump -Fp db_name | sed 's/^--//g' > db_name.txt.dump If no data has changed, doing this one day later will yield a dump that is 100% the same (as per md5sum). Since the txt dump is really big (in my case way over 2 Gb) I decided to compress it as well: pg_dump -Fp db_name | sed 's/^--//g' | gzip -n > db_name.txt.dump.gz This yields a file of 850 Mb, and the md5sums of unchanged db's are stil the same. When I try to dump to custom format, the dumps are *not* the same anymore, even though the data has *not* changed. Example: dumping a db that is not in use twice will yielf different files: $ pg_dump -Fc test > test1.dump $ pg_dump -Fc test > test2.dump $ md5sum test*.dump ec158ad86aabc7322c4b4dca58d6e4de test1.dump 9156ce40ae5f7c54c64382e078a2bb67 test2.dump I suspect it is because the -Fc format also contains comments etc. Is there a way to make -Fc dumps that do not contain any comments, timestamps or other stuff that makes consequent dumps of the same db different? This would be very helpfull. The txt dumps I use now are OK but are really big and slow to dump/restore. Best regards, -- * *** Dick Visser TIENHUIS Networking ** * * Touwbaan 68 P: +31206843731 * * *** 1018 HS Amsterdam F: +31208641420 * * * * The Netherlands M: +31622698108 * ** * IP-phone (SIP)/email: dick@tienhuis.nl * * * PGP-key: http://www.tienhuis.nl/gpg.txt * * * Webcam: http://www.tienhuis.nl/cam2.asx *** ***