X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id D38C53A2C45 for ; Sat, 15 Jan 2005 12:55:15 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 08559-04 for ; Sat, 15 Jan 2005 12:55:03 +0000 (GMT) Received: from mail.logi-track.com (www.logi-track.com [213.239.193.212]) by svr1.postgresql.org (Postfix) with ESMTP id B98003A2C39 for ; Sat, 15 Jan 2005 12:55:04 +0000 (GMT) Received: from kingfisher.intern.logi-track.com (p5088E2D4.dip0.t-ipconnect.de [80.136.226.212]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.logi-track.com (Postfix) with ESMTP id 74ACE30035 for ; Sat, 15 Jan 2005 13:55:05 +0100 (CET) Received: from [127.0.0.1] (localhost [127.0.0.1]) by kingfisher.intern.logi-track.com (Postfix) with ESMTP id 687BD16DF4F for ; Sat, 15 Jan 2005 13:55:00 +0100 (CET) Message-ID: <41E912A3.6070808@logi-track.com> Date: Sat, 15 Jan 2005 13:54:59 +0100 From: Markus Schaber User-Agent: Mozilla Thunderbird 1.0 (X11/20041218) X-Accept-Language: de-DE, de, en-us, en MIME-Version: 1.0 To: PostgreSQL SQL List Subject: Split pg_dump script X-Enigmail-Version: 0.89.6.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigA980C0371202B5BEE01AEC34" X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.05 tagged_above=0 required=5 tests=FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200501/110 X-Sequence-Number: 19898 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigA980C0371202B5BEE01AEC34 Content-Type: multipart/mixed; boundary="------------060803080408060105080906" This is a multi-part message in MIME format. --------------060803080408060105080906 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Hello, The attached dump_split.sh script maybe helpful to some of you. It is called with a database name and a base file name. It first dumps out the schema and metadata of the database in a plain SQL file. After this, it dumps out the data, each table into its own file, compressed with bzip2. This basically allows one to create an ascii dump of a large database and still open and edit the schema with your favourite text editor afterwards. It also allows restoration of single tables (create the table by copying the instructions from the schema file, and then restore the content by piping the data file via bunzip2 into psql). I know that pg_dump -Ft and -Fc also allow to do this, but bzip2 has a far better compression ratio on most data. Comments welcome (I'm subscribed to this list, so no need to Bcc:). HTH, Markus --------------060803080408060105080906 Content-Type: application/x-shellscript; name="dump_split.sh" Content-Transfer-Encoding: base64 Content-Disposition: inline; filename="dump_split.sh" IyEvYmluL2Jhc2gKIwojIChDKSAyMDA1IE1hcmt1cy5TY2hhYmVyQGxvZ2ktdHJhY2suY29t CiMKIyBUaGlzIGZpbGUgaXMgZnJlZSBzb2Z0d2FyZSBhbmQgbGljZW5zZWQgdW5kZXIgdGhl IEdOVSBHUEwuCiMKIyBLbm93biB3ZWFrbmVzc2VzOgojIC0gSSdtIG5vdCBzaHVyZSB3aGV0 aGVyIHRhYmxlcyBhbmQgc2VxdWVuY2VzIGFyZSB0aGUgb25seSB0aGluZyB0aGF0IGlzCiMg ICBpZ25vcmVkIGJ5IHBnX2R1bXAgLS1zY2hlbWFfb25seQojIC0ganVzdCBsaWtlIHBnX2R1 bXAsIGl0IGRvZXMgbm90IGR1bXAgbGFyZ2Ugb2JqZWN0cwojIC0gc2VxdWVuY2UgZGF0YSBp cyBhbHNvIGJ6aXBwZWQsIGFsdGhvdWdoIGl0IGlzIG5vdCB3b3J0aCB0aGUgZWZmb3J0Lgoj CiMgJElkOiBkdW1wX3NwbGl0LnNoLHYgMS4zIDIwMDUvMDEvMTUgMTI6NDc6MTMgc2NoYWJp IEV4cCAkCgppZiBbIC16ICQyIF07ICB0aGVuIAoJZWNobyB1c2FnZTogJDAgYmFzZW5h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Jhc2gK --------------060803080408060105080906-- --------------enigA980C0371202B5BEE01AEC34 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFB6RKjOVWsnapT9i0RArRbAKDPk0vcV2Sl8bPoN41qEiFkkrfp2gCgmIST uV9CdcJbxjgTIQRLEmlUnYQ= =a64T -----END PGP SIGNATURE----- --------------enigA980C0371202B5BEE01AEC34--