pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Thilina Gunasekara <tgunasekara@openworld.org>
To: Eduardo S . Fontanetti <dufuzzy@yahoo.com.br>
Cc: pgsql-admin@postgresql.org
Cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] Dump and Restore
Date: Tue, 24 Aug 2004 16:38:19 +0100
Message-ID: <GFEELPGDCGLLEBPEEOKGIEGJCAAA.tgunasekara@openworld.org> (raw)
In-Reply-To: <20040824162956.D17786@bacon>

Assuming you're using Unix Box
1. Dump your database DB_X
pg_dump -v -U postgresUsername DB_X | gzip -f - > DB_X.gz

2.Create database DB_Y
psql -U postgresUsername template1
CREATE DATABASE DB_Y
\q

3. zcat DB_X.gz | psql -U postgresUsername -f - DB_Y

Thilina


-----Original Message-----
From: pgsql-admin-owner@postgresql.org
[mailto:pgsql-admin-owner@postgresql.org]On Behalf Of Paul Thomas
Sent: 24 August 2004 16:30
To: Eduardo S . Fontanetti
Cc: pgsql-admin@postgresql.org; pgsql-general@postgresql.org
Subject: Re: [ADMIN] [GENERAL] Dump and Restore



On 24/08/2004 14:40 Eduardo S. Fontanetti wrote:
> How can I do a test if my dumping is really working, I
> can't apply the dump in my database, because it will
> overwrite a lot of data. I was thinking about restore
> in another database name, but I can't, it always
> restore on the original database.
>
> Somebody have a cooking recipe about to test if my
> backup is working fine, and will help if I need
> sometime?

Are you using pg_dump or pg_dumpall? I just use pg_dump on individual
databases (pg_dumpall works on the whole cluster) and can restore that to
any database.


HTH

--
Paul Thomas
+------------------------------+--------------------------------------------
-+
| Thomas Micro Systems Limited | Software Solutions for
Business             |
| Computer Consultants         |
http://www.thomas-micro-systems-ltd.co.uk   |
+------------------------------+--------------------------------------------
-+

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

               http://www.postgresql.org/docs/faqs/FAQ.html




view thread (8+ messages)  latest in thread

Message-ID: <GFEELPGDCGLLEBPEEOKGIEGJCAAA.tgunasekara@openworld.org>
Permalink:  ../GFEELPGDCGLLEBPEEOKGIEGJCAAA.tgunasekara@openworld.org/
Also on:    postgresql.org/message-id/GFEELPGDCGLLEBPEEOKGIEGJCAAA.tgunasekara@openworld.org

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: tgunasekara@openworld.org, dufuzzy@yahoo.com.br, pgsql-general@postgresql.org
  Subject: Re: [GENERAL] Dump and Restore
  In-Reply-To: <GFEELPGDCGLLEBPEEOKGIEGJCAAA.tgunasekara@openworld.org>
  References: <20040824162956.D17786@bacon> <GFEELPGDCGLLEBPEEOKGIEGJCAAA.tgunasekara@openworld.org>

* 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