With thanks to shammat, for his step-by-step directions, originally posted here.- Make a backup of your current data directory
- Make sure you have a backup of your data directory
- Install Postgres vx.x again, overwriting the current data directory (did you make sure you have a backup?)
- Shut down the Postgres service
- Make sure the Postgres service has stopped
- Check that Postgres is not running
- Copy the backup of your data directory to the original location (make sure Postgres is not running when you do that)
- Start the postgres service again
Now, you should have a working Postgres server, with data restored and current, as of the point in time that you uninstalled Postgres without a backup.