I take daily backs of our postgres development box using: pg_dumpall -h 127.0.0.1 -U user -w | gzip blah.gz
Since 9.0 is now a release candidate I would like to restore this daily backup on a daily basis to a postgres9.0rc1 box for testing, however I'm not sure how to script it repeatedly. Is there some directory I can nuke to do this?
Version (3.0. 2b) of OmniDB does not have an option for selecting and dropping multiple databases. To drop a database in OmniDB, you right-click on a database, select Drop Database from the context menu, run the query to drop the database, and finally close the query window.
But there is another way in pgAdmin4: Close connections to the databases you would like to delete by right-clicking on it and selecting "Disconnect database..." Left-click on "Databases" (One up in the hierarchy: The folder that contains all your databases)
You can delete the postgres but do not touch template0 or template1. The postgres database is there for convenience.
You can do "drop cluster" and "create cluster" which will automtically erase all databases. Erase all data in you $PGDATA directory and reinit the cluster using:
initdb -D /usr/local/pgsql/data
You can use:
$ pg_dropcluster 9.2 main $ pg_createcluster 9.2 main $ pg_ctlcluster 9.2 main start $ pg_restore -f your_dump_file
where 9.2
= cluster version
and main
= cluster name
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With