pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Markus Schaber <schabios@logi-track.com>
To: PostgreSQL SQL List <pgsql-sql@postgresql.org>
Subject: Split pg_dump script
Date: Sat, 15 Jan 2005 13:54:59 +0100
Message-ID: <41E912A3.6070808@logi-track.com> (raw)

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

Attachments:

  dump_split.sh (application/x-shellscript, 1.2K) download

  signature.asc (application/pgp-signature, 255B) download

Message-ID: <41E912A3.6070808@logi-track.com>
Permalink:  ../41E912A3.6070808@logi-track.com/
Also on:    postgresql.org/message-id/41E912A3.6070808@logi-track.com

 · 

reply

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: schabios@logi-track.com
  Subject: Re: Split pg_dump script
  In-Reply-To: <41E912A3.6070808@logi-track.com>

* 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