making snapshots of postgres db
im trying to write a python script that takes snapshots of a postgres database and restores those snapshots.  trying to get pg_dump > data.sql to work has been a nightmare and i came across an idea that i wanted to run past you guys.

the idea is to follow this logic for taking the snapshot:

    1 - stop the postgres daemon
    2 - copy the {postgres}/data folder out
    3 - start the daemon

then to restore a snapshot:

    1 - stop the postgres daemon
    2 - delete the {postgres}/data folder
    3 - copy the snapshot data folder in place
    4 - reset the permissions of the data folder to the postgres user
    5 - start the daemon

this is a test database so downtime isn't an issue.

making snapshots of postgres db
===

im trying to write a python script that takes snapshots of a postgres database and restores those snapshots.  trying to get pg_dump > data.sql to work has been a nightmare and i came across an idea that i wanted to run past you guys.

the idea is to follow this logic for taking the snapshot:

    1 - stop the postgres daemon
    2 - copy the {postgres}/data folder out
    3 - start the daemon

then to restore a snapshot:

    1 - stop the postgres daemon
    2 - delete the {postgres}/data folder
    3 - copy the snapshot data folder in place
    4 - reset the permissions of the data folder to the postgres user
    5 - start the daemon

this is a test database so downtime isn't an issue.
