Skip to content
This repository has been archived by the owner on Jan 6, 2023. It is now read-only.

suhlig/postgres-pitr

Repository files navigation

Spike on Postgres PITR

This is basically an acceptance test implementing the Point-in-Time Recovery chapter of the pgBackRest User Guide .

TL;DR

$ git clone https://github.com/suhlig/postgres-pitr
$ cd postgres-pitr
$ scripts/setup
$ tmuxinator

When done, issue tmuxinator stop local, and the VM will be shut down, too.

Development

This project requires Go >= v1.11 because we are using modules.

Setup

$ scripts/setup

Run Tests

$ bin/ginkgo -v -r

Iterate

  • Run tests when they changed:

    $ bin/ginkgo watch -v -r
  • Provision using Ansible when a deployment-related file has changed or a new one was added:

    $ scripts/watch
  • Optionally, run the linter:

    $ bin/golint ./...

References

TODO

  • Use "net/url" in config.go
  • Separate database config (incl. db name, user and password) from DB cluster config
  • Optionally restore only a selected databases; see https://pgbackrest.org/user-guide.html#restore/option-db-include
  • Do not rely on the main cluster, but create a separate one (sudo pg_createcluster 9.4 demo etc.)
  • Run pg_create_restore_point through native DB driver instead of SSH
  • Test more than the happy path