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

Поиск
Список
Период
Сортировка
От Ron
Тема Re: pg_restore to new database wants to wipe out the old database?
Дата
Msg-id 8271fb47-8f04-a02b-2927-e475659274dd@gmail.com
обсуждение исходный текст
Ответ на Re: pg_restore to new database wants to wipe out the old database?  ("David G. Johnston" <david.g.johnston@gmail.com>)
Ответы Re: pg_restore to new database wants to wipe out the old database?
Список pgsql-general
On 10/30/2018 05:16 PM, David G. Johnston wrote:
On Tue, Oct 30, 2018 at 3:09 PM Ron <ronljohnsonjr@gmail.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."

So I've got to explicitly CREATE DATABASE "Molson" and then
pg_restore -d Molson Molson


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.


--
Angular momentum makes the world go 'round.

В списке pgsql-general по дате отправления:

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Re: pg_restore to new database wants to wipe out the old database?
Следующее
От: Nicolas Paris
Дата:
Сообщение: Full-text Search - Thesaurus relationships