If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > PostgreSQL > Dumping Database w/ Custom Switches

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-15-11, 10:43
CarlosinFL CarlosinFL is offline
Registered User
 
Join Date: Oct 2010
Location: Orlando, FL
Posts: 184
Dumping Database w/ Custom Switches

I was told there's a way to perform a 'pg_dump' that will also eliminate the need for me to create the database again before restoring the dump with 'pg_restore'. I've read the PostgreSQL manual and it says:

Code:
pg_dump dbname > outfile
That's a standard pg_dump which still requires me to create the database & associated roles before restoring.

Then it says:

Quote:
24.1.1. Restoring the Dump

The text files created by pg_dump are intended to be read in by the psql program. The general command form to restore a dump is
Code:
psql dbname < infile
So my question is why does it recommend psql to restore the pg_dump file? It seems that restoring from a text method isn't good practice, no?

And how can I perform a pg_dump and not need to create the database before the pg_restore process?
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On