pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedpg_dump --clean or dropdb?
2+ messages / 2 participants
[nested] [flat]
* pg_dump --clean or dropdb?
@ 2008-02-21 18:39 Ray Stell <stellr@cns.vt.edu>
2008-02-21 19:50 ` Re: pg_dump --clean or dropdb? Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 2+ messages in thread
From: Ray Stell @ 2008-02-21 18:39 UTC (permalink / raw)
To: 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;
...
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: pg_dump --clean or dropdb?
2008-02-21 18:39 pg_dump --clean or dropdb? Ray Stell <stellr@cns.vt.edu>
@ 2008-02-21 19:50 ` Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 0 replies; 2+ messages in thread
From: Tom Lane @ 2008-02-21 19:50 UTC (permalink / raw)
To: Ray Stell <stellr@cns.vt.edu>; +Cc: pgsql-admin
Ray Stell <stellr@cns.vt.edu> writes:
> 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?.
"strings" is not the way to find out what will be emitted by pg_restore.
(Hint: there are commands in the dump archive that may or may not be
used by pg_restore.) Use a plain pg_dump command, or equivalently look
at pg_restore's output script.
regards, tom lane
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2008-02-21 19:50 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2008-02-21 18:39 pg_dump --clean or dropdb? Ray Stell <stellr@cns.vt.edu>
2008-02-21 19:50 ` Tom Lane <tgl@sss.pgh.pa.us>
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