pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
refreshing a database with pg_dump and  psql
8+ messages / 4 participants
[nested] [flat]

* refreshing a database with pg_dump and  psql
@ 2015-05-26 21:09 Rossi, Maria <maria.rossi@us.pgds.com>
  2015-05-26 21:25 ` Re: refreshing a database with pg_dump and psql David G. Johnston <david.g.johnston@gmail.com>
  2015-05-26 21:27 ` Re: refreshing a database with pg_dump and  psql Jan Lentfer <Jan.Lentfer@web.de>
  0 siblings, 2 replies; 8+ messages in thread

From: Rossi, Maria @ 2015-05-26 21:09 UTC (permalink / raw)
  To: pgsql-admin

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.


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

^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: refreshing a database with pg_dump and psql
  2015-05-26 21:09 refreshing a database with pg_dump and  psql Rossi, Maria <maria.rossi@us.pgds.com>
@ 2015-05-26 21:25 ` David G. Johnston <david.g.johnston@gmail.com>
  2015-05-26 21:27   ` Re: refreshing a database with pg_dump and psql Rossi, Maria <maria.rossi@us.pgds.com>
  2015-05-27 00:38   ` Re: refreshing a database with pg_dump and psql Wei Shan <weishan.ang@gmail.com>
  1 sibling, 2 replies; 8+ messages in thread

From: David G. Johnston @ 2015-05-26 21:25 UTC (permalink / raw)
  To: Rossi, Maria <maria.rossi@us.pgds.com>; +Cc: pgsql-admin

On Tuesday, May 26, 2015, Rossi, Maria <maria.rossi@us.pgds.com> wrote:
>
> 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?
>
You should probably expound on what you mean by "refresh".

David J.

^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: refreshing a database with pg_dump and psql
  2015-05-26 21:09 refreshing a database with pg_dump and  psql Rossi, Maria <maria.rossi@us.pgds.com>
  2015-05-26 21:25 ` Re: refreshing a database with pg_dump and psql David G. Johnston <david.g.johnston@gmail.com>
@ 2015-05-26 21:27   ` Rossi, Maria <maria.rossi@us.pgds.com>
  1 sibling, 0 replies; 8+ messages in thread

From: Rossi, Maria @ 2015-05-26 21:27 UTC (permalink / raw)
  To: 'David G. Johnston' <david.g.johnston@gmail.com>; +Cc: pgsql-admin

Sorry,   I mean to say, reload  the database.  Does that makes sense?

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: David G. Johnston [mailto:david.g.johnston@gmail.com]
Sent: Tuesday, May 26, 2015 5:26 PM
To: Rossi, Maria
Cc: pgsql-admin@postgresql.org
Subject: Re: [ADMIN] refreshing a database with pg_dump and psql

On Tuesday, May 26, 2015, Rossi, Maria <maria.rossi@us.pgds.com<mailto:maria.rossi@us.pgds.com>> wrote:
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?
You should probably expound on what you mean by "refresh".

David J.


^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: refreshing a database with pg_dump and psql
  2015-05-26 21:09 refreshing a database with pg_dump and  psql Rossi, Maria <maria.rossi@us.pgds.com>
  2015-05-26 21:25 ` Re: refreshing a database with pg_dump and psql David G. Johnston <david.g.johnston@gmail.com>
@ 2015-05-27 00:38   ` Wei Shan <weishan.ang@gmail.com>
  1 sibling, 0 replies; 8+ messages in thread

From: Wei Shan @ 2015-05-27 00:38 UTC (permalink / raw)
  To: David G. Johnston <david.g.johnston@gmail.com>; +Cc: pgsql-admin@postgresql.org, "Rossi, Maria" <maria.rossi@us.pgds.com>

I think he meant to keep a development database  in sync with the
production database.
On 27 May 2015 7:36 am, "David G. Johnston" <david.g.johnston@gmail.com>
wrote:

> On Tuesday, May 26, 2015, Rossi, Maria <maria.rossi@us.pgds.com> wrote:
>>
>> 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?
>>
> You should probably expound on what you mean by "refresh".
>
> David J.
>

^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: refreshing a database with pg_dump and  psql
  2015-05-26 21:09 refreshing a database with pg_dump and  psql Rossi, Maria <maria.rossi@us.pgds.com>
@ 2015-05-26 21:27 ` Jan Lentfer <Jan.Lentfer@web.de>
  2015-05-26 21:36   ` Re: refreshing a database with pg_dump and psql David G. Johnston <david.g.johnston@gmail.com>
  1 sibling, 1 reply; 8+ messages in thread

From: Jan Lentfer @ 2015-05-26 21:27 UTC (permalink / raw)
  To: Rossi, Maria <maria.rossi@us.pgds.com>; +Cc: pgsql-admin





> Am 26.05.2015 um 23:09 schrieb Rossi, Maria <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.

Regards

Jan=

^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: refreshing a database with pg_dump and psql
  2015-05-26 21:09 refreshing a database with pg_dump and  psql Rossi, Maria <maria.rossi@us.pgds.com>
  2015-05-26 21:27 ` Re: refreshing a database with pg_dump and  psql Jan Lentfer <Jan.Lentfer@web.de>
@ 2015-05-26 21:36   ` David G. Johnston <david.g.johnston@gmail.com>
  2015-05-26 21:41     ` Re: refreshing a database with pg_dump and psql Jan Lentfer <Jan.Lentfer@web.de>
  0 siblings, 1 reply; 8+ messages in thread

From: David G. Johnston @ 2015-05-26 21:36 UTC (permalink / raw)
  To: Jan Lentfer <Jan.Lentfer@web.de>; +Cc: Rossi, Maria <maria.rossi@us.pgds.com>; pgsql-admin

On Tue, May 26, 2015 at 2:27 PM, Jan Lentfer <Jan.Lentfer@web.de> wrote:

>
> Am 26.05.2015 um 23:09 schrieb Rossi, Maria <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.

David J.​

^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: refreshing a database with pg_dump and psql
  2015-05-26 21:09 refreshing a database with pg_dump and  psql Rossi, Maria <maria.rossi@us.pgds.com>
  2015-05-26 21:27 ` Re: refreshing a database with pg_dump and  psql Jan Lentfer <Jan.Lentfer@web.de>
  2015-05-26 21:36   ` Re: refreshing a database with pg_dump and psql David G. Johnston <david.g.johnston@gmail.com>
@ 2015-05-26 21:41     ` Jan Lentfer <Jan.Lentfer@web.de>
  2015-05-27 00:44       ` Re: refreshing a database with pg_dump and psql Rossi, Maria <maria.rossi@us.pgds.com>
  0 siblings, 1 reply; 8+ messages in thread

From: Jan Lentfer @ 2015-05-26 21:41 UTC (permalink / raw)
  To: David G. Johnston <david.g.johnston@gmail.com>; +Cc: Rossi, Maria <maria.rossi@us.pgds.com>; pgsql-admin



> Am 26.05.2015 um 23:36 schrieb David G. Johnston <david.g.johnston@gmail.com>:
> 
>> On Tue, May 26, 2015 at 2:27 PM, Jan Lentfer <Jan.Lentfer@web.de> wrote:
> 
>> 
>>> Am 26.05.2015 um 23:09 schrieb Rossi, Maria <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=

^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: refreshing a database with pg_dump and psql
  2015-05-26 21:09 refreshing a database with pg_dump and  psql Rossi, Maria <maria.rossi@us.pgds.com>
  2015-05-26 21:27 ` Re: refreshing a database with pg_dump and  psql Jan Lentfer <Jan.Lentfer@web.de>
  2015-05-26 21:36   ` Re: refreshing a database with pg_dump and psql David G. Johnston <david.g.johnston@gmail.com>
  2015-05-26 21:41     ` Re: refreshing a database with pg_dump and psql Jan Lentfer <Jan.Lentfer@web.de>
@ 2015-05-27 00:44       ` Rossi, Maria <maria.rossi@us.pgds.com>
  0 siblings, 0 replies; 8+ messages in thread

From: Rossi, Maria @ 2015-05-27 00:44 UTC (permalink / raw)
  To: Jan Lentfer <Jan.Lentfer@web.de>; 'David G. Johnston' <david.g.johnston@gmail.com>; +Cc: pgsql-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


^ permalink  raw  reply  [nested|flat] 8+ messages in thread


end of thread, other threads:[~2015-05-27 00:44 UTC | newest]

Thread overview: 8+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2015-05-26 21:09 refreshing a database with pg_dump and  psql Rossi, Maria <maria.rossi@us.pgds.com>
2015-05-26 21:25 ` Re: refreshing a database with pg_dump and psql David G. Johnston <david.g.johnston@gmail.com>
2015-05-26 21:27   ` Re: refreshing a database with pg_dump and psql Rossi, Maria <maria.rossi@us.pgds.com>
2015-05-27 00:38   ` Re: refreshing a database with pg_dump and psql Wei Shan <weishan.ang@gmail.com>
2015-05-26 21:27 ` Jan Lentfer <Jan.Lentfer@web.de>
2015-05-26 21:36   ` Re: refreshing a database with pg_dump and psql David G. Johnston <david.g.johnston@gmail.com>
2015-05-26 21:41     ` Re: refreshing a database with pg_dump and psql Jan Lentfer <Jan.Lentfer@web.de>
2015-05-27 00:44       ` Re: refreshing a database with pg_dump and psql Rossi, Maria <maria.rossi@us.pgds.com>

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