Re: pg_restore to new database wants to wipe out the old database?

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Ron <ronljohnsonjr(at)gmail(dot)com>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: pg_restore to new database wants to wipe out the old database?
Date: 2018-10-30 22:16:13
Message-ID: CAKFQuwa5u18ASfLW4dinnuaZL9aYMwbLQP1TYtAxTu0=aWzJ4w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Oct 30, 2018 at 3:09 PM Ron <ronljohnsonjr(at)gmail(dot)com> wrote:

> Hi,
>
> v9.6.9
>
> Why is pg_restore trying to drop my production database, when I (think I)
> am telling it to create the new database "Molson"?
>

Straight from the pg_restore documentation:

-C

"When this option is used, the database named with -d is used only to issue
the initial DROP DATABASE and CREATE DATABASE commands. All data is
restored into the database name that appears in the archive."

Also
" pg_restore -vcC --if-exists --jobs=8 -d postgres Molson "

pg_restore [connection-option...] [option...] [filename]

"Molson" is a file name; pg_restore doesn't use the file name aside from
finding where the data you want to restore is located.

David J.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ron 2018-10-30 22:25:57 Re: pg_restore to new database wants to wipe out the old database?
Previous Message Ron 2018-10-30 22:08:35 pg_restore to new database wants to wipe out the old database?