pg_restore and the -C flag

From: John Scalia <jayknowsunix(at)gmail(dot)com>
To: pgsql-admin(at)postgresql(dot)org
Subject: pg_restore and the -C flag
Date: 2019-07-17 12:43:43
Message-ID: 4C9267A4-5A07-4FC0-B331-40EA95959534@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Hi all,

From what I’m reading on www.postgresql.org, the -C option for pg_restore is supposed to create the database before restoring into it, but here’s my command line:

pg_restore -p 5432 -C -d restored_db recovery.dmp

The dmp file was created with pg_dump using

pg_dump -p 5432 -F c orig_db > recovery.dmp.

Pg_restore errors saying the database does not exist. Yes, I know that port 5432 is the default, but not all of our databases are. So, do I have any options wrong with either utility? Or why is this happening? I’m just trying to document a recovery procedure and testing my documentation.

Jay

Sent from my iPhone

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Keith 2019-07-17 13:19:09 Re: pg_restore and the -C flag
Previous Message Cumer Cristiano 2019-07-16 15:30:07 Posters 9.3 - ubuntu 16.04 - Are clogs entires automatically deleted?