No description
This repository has been archived on 2026-04-20. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
  • Python 92.7%
  • Dockerfile 7.3%
Find a file
Chris Pressland 55f9eeffed
Some checks failed
ci / tests (push) Failing after 3s
ci / build (push) Has been skipped
Change database connection string format
2022-09-13 13:59:29 +01:00
.github/workflows Initial Commit 2021-11-16 14:46:22 +00:00
deploy Change database connection string format 2022-09-13 13:59:29 +01:00
.flake8 Initial Commit 2021-11-16 14:46:22 +00:00
.gitignore Initial Commit 2021-11-16 14:46:22 +00:00
Dockerfile Change database connection string format 2022-09-13 13:59:29 +01:00
LICENSE Initial Commit 2021-11-16 14:46:22 +00:00
main.py Change database connection string format 2022-09-13 13:59:29 +01:00
Pipfile Change database connection string format 2022-09-13 13:59:29 +01:00
Pipfile.lock Change database connection string format 2022-09-13 13:59:29 +01:00
README.md Change database connection string format 2022-09-13 13:59:29 +01:00

postgres-to-postgres

Copies a Postgres Database to another Postgres Server.

Things I don't like about this project

Database Connection Strings

Both source_database_dsn and destination_database_dsn require values where the database name is set to {} for example: postgresql://username:password@someserver:5432/{}?sslmode=require, we then use source_database_name and destination_database_name to set the actual database name. We do this to simplify the way we inject environment variables into a Kubernetes Cluster.

My intention is to come back to this and improve it, eventually.

Why no retry logic?

pg_dump and pg_restore can get quite shouty when going between different versions of Postgres, and rightly so. Unfortunately Microsoft does not offer PostgreSQL 13 everywhere yet, so I have shell_check disabled by default. Once Microsoft fully support PostgreSQL 13, or we drop use of Single Server internally, I'll add proper retries and error handling