Re: Dump all in several files

From: Lonni J Friedman <netllama(at)gmail(dot)com>
To: Frederic Massot <frederic(at)juliana-multimedia(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Dump all in several files
Date: 2005-03-15 15:54:01
Message-ID: 7c1574a905031507541c308315@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, 15 Mar 2005 16:43:01 +0100, Frederic Massot
<frederic(at)juliana-multimedia(dot)com> wrote:
> Hi,
>
> On the PostgreSQL 6.5 server I use this shell script (see below) for the
> backup all of the database in several files, one file per database.
>
> With version 7.3 of PostgreSQL (and the following) the data are not
> recorded any more in a repertory with the name of the database, but with
> the OID of the basebase.
>
> Do you know how I can adapt this script?
>
> If a developer of pg_dumpall reads this post, is it possible to add to
> the command pg_dumpall an option to record one database per file?
>
> Regards.
>
> #! /bin/bash
> #
> for p in $(find /var/lib/postgres/data/base/ -type d -print -mindepth 1
> -maxdepth 1 )
> do
> base=`basename "$p"`
> pg_dump -d -f /var/backup/postgresql/dump_$base $base
> done

Maybe i'm just not following you, but why can't you just do:
pg_dump $DBNAME >$DB_NAME

where $DB_NAME is the name of each database on the box?

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
L. Friedman netllama(at)gmail(dot)com
LlamaLand http://netllama.linux-sxs.org

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Frederic Massot 2005-03-15 16:01:39 Re: Dump all in several files
Previous Message Frederic Massot 2005-03-15 15:43:01 Dump all in several files