0

I'm trying to find the best approach for storing postgresql data. Starting with docker 1.9, looks like named volume are the way to go.

For backup, I'v seen around that people tar the volume to store it. However I'm concerned about the consistency of the resulting archive if the DB is in the middle of writing something for example. Can't this be an issue ?

I know about PG native mechanisms like pg_dump, I'm just wondering if what seems to be the docker way is compatible with a running DB system (I don(t think so, but want to be sure)

Thanks.

Mat
  • 1,309
  • 1
  • 20
  • 43
  • 1
    Look at my answer here - https://stackoverflow.com/questions/48187662/postgresql-db-backup-ideal-practices - here are some notes you could find helpful. Safest way is to use PG own mechanisms. – JosMac Jan 23 '18 at 11:51
  • You can use pg_dump: pg_dump is a utility for backing up a PostgreSQL database. It makes consistent backups even if the database is being used concurrently. Looking to this question you can create dumps: (cron job?): https://stackoverflow.com/questions/30171063/how-to-generate-a-postgresql-dump-from-a-docker-container and you can backup those dumps. – lvthillo Jan 23 '18 at 12:38
  • Thanks for your answers. Yes I konw about PG native mechanisms, I was wondering about docker approach compatibility with a rinning DB system. Editing my question to be more precise – Mat Jan 23 '18 at 13:04

0 Answers0