Submitted by Robert Treat (not verified) on Fri, 2008-02-15 08:36.
There is always some history to why software decisions are made one way for one project, but differently for another. I think the reason that pg_dump doesn't create the databases for you is that it is aimed more as a general backup tool. The ability to take dump output and reload it into any database, regardless of name, has been seen as one upside. Also this allows database owners to manage thier own backups/restores without having to grant them database creation privileges. If you want to include the create database command, you can use --create flag to pg_dump to make it so.
WRT your statement that it couldn't reload the dump file that was created, that does seem odd, though I can think of some cases where you might run into problems. Without further information it's hard to give any explination, but should you find yourself in that siutuation again, please send an email to the pgsql mailing lists with details.
»
Reply
Search
Windows for Intel Macs
Todd Ogasawara's Windows for Intel Macs ($7.99USD published by O'Reilly Media) is for Intel Mac users running Bootcamp or Parallels who want to learn more about running Microsoft Windows XP on Mac. It also provides specific tips and hints for using Parallels Desktop for Mac.
There is always some history
There is always some history to why software decisions are made one way for one project, but differently for another. I think the reason that pg_dump doesn't create the databases for you is that it is aimed more as a general backup tool. The ability to take dump output and reload it into any database, regardless of name, has been seen as one upside. Also this allows database owners to manage thier own backups/restores without having to grant them database creation privileges. If you want to include the create database command, you can use --create flag to pg_dump to make it so.
WRT your statement that it couldn't reload the dump file that was created, that does seem odd, though I can think of some cases where you might run into problems. Without further information it's hard to give any explination, but should you find yourself in that siutuation again, please send an email to the pgsql mailing lists with details.