Re: restore a dump db from tar file

From: "Scott Marlowe" <scott(dot)marlowe(at)gmail(dot)com>
To: "Alain Roger" <raf(dot)news(at)gmail(dot)com>
Cc: rod(at)iol(dot)ie, pgsql-general(at)postgresql(dot)org
Subject: Re: restore a dump db from tar file
Date: 2008-10-06 16:11:16
Message-ID: dcc563d10810060911g4c9cebb0s297638c16217f46b@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Oct 6, 2008 at 9:12 AM, Alain Roger <raf(dot)news(at)gmail(dot)com> wrote:
>
> AFAIK, pg_dump -v -o -U username -ci -Ft -f tarname.tar dbname
> backup the DB but without inserting code to create the BD itself... just to
> create its structure and populate it.
> noting about create database dbname
> grant. ...
>
> how can i do that automatically ?
> i mean when i dump my db, how can i dump ALSO the script to create the BD
> and its property ?

pg_dumpall produces such output. You could do a schema only
pg_dumpall and grep out the parts you need for that one db.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Raymond O'Donnell 2008-10-06 16:31:35 Re: restore a dump db from tar file
Previous Message Scott Marlowe 2008-10-06 16:07:39 Re: Re: [Pkg-postgresql-public] Postgres major version support policy on Debian