Skip site navigation (1) Skip section navigation (2)

pg_dump --clean or dropdb?

From: Ray Stell <stellr(at)cns(dot)vt(dot)edu>
To: pgsql-admin(at)postgresql(dot)org
Subject: pg_dump --clean or dropdb?
Date: 2008-02-21 18:39:39
Message-ID: 20080221183939.GA31300@cns.vt.edu (view raw or flat)
Thread:
Lists: pgsql-admin
I have two versions of a db that I'd like to sync from a point-in-time
backup.  One set of data is perfered over the other so the db on the
target system will need to be tossed.

Will pg_dump --clean fix up the target or do I need to dropdb instead?
The favored data is in under 8.2.1 and the target system is 8.2.6.

The doc for pg_dump --clean says it will drop db objects, not the db, 
however it looks like it does, though the output order of events is
troubling.  Is there a loop in the create/drop area?.  

pgdump.test.dmp came from pg_dump -Fc :

$ strings pgdump.test.dmp 
PGDMP
ghiza
8.2.1
8.2.1
ENCODING
ENCODING
SET client_encoding = 'UTF8';
false
STDSTRINGS
STDSTRINGS
SET standard_conforming_strings = 'off';
false
1262
16384
ghiza
DATABASE
CREATE DATABASE ghiza WITH TEMPLATE = template0 ENCODING = 'UTF8';
DROP DATABASE ghiza;
...


Responses

pgsql-admin by date

Next:From: Tom LaneDate: 2008-02-21 19:50:07
Subject: Re: pg_dump --clean or dropdb?
Previous:From: Tom LaneDate: 2008-02-21 17:55:19
Subject: Re: Stable Release?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group