I periodically take snapshots of my current development database to
facilitate recovery from screw-ups. I do so roughly like this:
createdb -EUTF-8 db-snapshot
pg_dump -Fc db | pg_restore -d db-snapshot
For which I get the fairly innocuous error:
pg_restore: WARNING: database comments may only be applied to
the current database
I'm not aware of any other part of a database dump that references the
source database by name (nor should it, since this would cause problems
when restoring to a different database name).
Is there a better way to snaphsot a database? createdb -T db db-snapshot
seemed like a good idea, but that requires the template db to not be in
use (ie, no logged in users).
I'm running 8.1.8 and will move to 8.2.3 shortly.
Thanks,
Reece
--
Reece Hart, http://harts.net/reece/, GPG:0x25EC91A0
./universe -G 6.672e-11 -e 1.602e-19 -protonmass 1.673e-27 -uspres bush
kernel warning: universe consuming too many resources. Killing.
universe killed due to catastrophic leadership. Try -uspres carter.