X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id EF2DB5E3F15; Tue, 24 Aug 2004 12:38:21 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 30877-08; Tue, 24 Aug 2004 15:38:24 +0000 (GMT) Received: from glenis.uk1.openworld.co.uk (glenis.uk1.openworld.co.uk [82.211.89.4]) by svr1.postgresql.org (Postfix) with ESMTP id 377365E40BA; Tue, 24 Aug 2004 12:38:14 -0300 (ADT) Received: from [195.102.152.166] (helo=oww03) by glenis.uk1.openworld.co.uk with asmtp (TLSv1:RC4-MD5:128) (Exim 4.34) id 1BzdNT-0001LL-1o; Tue, 24 Aug 2004 15:38:27 +0000 Reply-To: From: "Thilina Gunasekara" To: "Eduardo S . Fontanetti" Cc: , Subject: Re: [GENERAL] Dump and Restore Date: Tue, 24 Aug 2004 16:38:19 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4925.2800 In-Reply-To: <20040824162956.D17786@bacon> X-SA-Exim-Connect-IP: 195.102.152.166 X-SA-Exim-Mail-From: tgunasekara@openworld.org X-SA-Exim-Scanned: No (on glenis.uk1.openworld.co.uk); SAEximRunCond expanded to false X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200408/231 X-Sequence-Number: 14626 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