Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 0A1282E0080 for ; Thu, 21 Feb 2008 14:40:30 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 67129-01-9 for ; Thu, 21 Feb 2008 14:40:12 -0400 (AST) Received: from locust.cns.vt.edu (locust.cns.vt.edu [198.82.169.14]) by postgresql.org (Postfix) with ESMTP id A0B532E00CF for ; Thu, 21 Feb 2008 14:39:40 -0400 (AST) Received: by locust.cns.vt.edu (Postfix, from userid 986) id 2E2A6118A4B; Thu, 21 Feb 2008 13:39:39 -0500 (EST) Date: Thu, 21 Feb 2008 13:39:39 -0500 From: Ray Stell To: pgsql-admin@postgresql.org Subject: pg_dump --clean or dropdb? Message-ID: <20080221183939.GA31300@cns.vt.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.17 (2007-11-01) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200802/246 X-Sequence-Number: 28320 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; ...