Split pg_dump script - Mailing list pgsql-sql

From Markus Schaber
Subject Split pg_dump script
Date
Msg-id 41E912A3.6070808@logi-track.com
Whole thread Raw
List pgsql-sql
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


Attachment

pgsql-sql by date:

Previous
From: Bruno Wolff III
Date:
Subject: Re: return value of the trigger function
Next
From: "j.random.programmer"
Date:
Subject: SQL design question: null vs. boolean values