pg_restore and database comments - Mailing list pgsql-general

From Reece Hart
Subject pg_restore and database comments
Date
Msg-id 1173315179.16912.35.camel@snafu.site
Whole thread Raw
List pgsql-general
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.


pgsql-general by date:

Previous
From: snacktime
Date:
Subject: server vendor recommendation
Next
From: "Joshua D. Drake"
Date:
Subject: Re: [HACKERS] WITH/RECURSIVE plans