From: Rossi, Maria <maria.rossi@us.pgds.com>
To: Jan Lentfer <Jan.Lentfer@web.de>
To: 'David G. Johnston' <david.g.johnston@gmail.com>
Cc: 'pgsql-admin@postgresql.org' <pgsql-admin@postgresql.org>
Subject: Re: refreshing a database with pg_dump and psql
Date: Wed, 27 May 2015 00:44:32 +0000
Message-ID: <d19fbb1d0c48428eb86b78b8e5bdd6f4@DC01PXMBP003.jacksonnational.com> (raw)
In-Reply-To: <0DA2B66E-3916-4514-B4DD-7380622D930D@web.de>
References: <f39c1b101fe5410a93f57d2f5a0edefe@DC01PXMBP003.jacksonnational.com>
<C923B445-0BFB-4113-8BF5-873244A97B75@web.de>
<CAKFQuwa3M_hDYnbnDdT0e3v=O+1xeDzkdgs1Ssan2eo=Sa70KQ@mail.gmail.com>
<0DA2B66E-3916-4514-B4DD-7380622D930D@web.de>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-admin>
I will try the pg_restore –cC or drop the database first.
Thank you all for the quick response.
Maria A Rossi
Database Administration
PGDS (US)
email: maria.rossi@us.pgds.com<mailto:maria.rossi@us.pgds.com>
cell phone: 517.256.4392
work phone: 517.367.3099
work phone extension: 23099
From: Jan Lentfer [mailto:Jan.Lentfer@web.de]
Sent: Tuesday, May 26, 2015 5:41 PM
To: David G. Johnston
Cc: Rossi, Maria; pgsql-admin@postgresql.org
Subject: Re: [ADMIN] refreshing a database with pg_dump and psql
Am 26.05.2015 um 23:36 schrieb David G. Johnston <david.g.johnston@gmail.com<mailto:david.g.johnston@gmail.com>>:
On Tue, May 26, 2015 at 2:27 PM, Jan Lentfer <Jan.Lentfer@web.de<mailto:Jan.Lentfer@web.de>> wrote:
Am 26.05.2015 um 23:09 schrieb Rossi, Maria <maria.rossi@us.pgds.com<mailto:maria.rossi@us.pgds.com>>:
Hi,
I have a database that was created from a ‘pg_dump –C’. No problems there. Then I ran the pg_dump again, this time without the –C. and tried to load it. But got a bunch of ‘object already exist’.
Can’t I refresh an existing database from a plain pg_dump? Is there an option that I have to use?
Thanks.
Check the pg_restore manual. There is a "clean" option when using the custom format. I think this is what you are looking for.
Or just inject a "DROP DATABASE ..." into the equation somewhere.
pg_restore -cC will do that, too.
Jan
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 using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: maria.rossi@us.pgds.com, Jan.Lentfer@web.de, david.g.johnston@gmail.com
Subject: Re: refreshing a database with pg_dump and psql
In-Reply-To: <d19fbb1d0c48428eb86b78b8e5bdd6f4@DC01PXMBP003.jacksonnational.com>
* 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