Skip to content

Instantly share code, notes, and snippets.

@ripper2hl
Created September 30, 2019 07:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ripper2hl/926489df2d13995abc3d57258e687514 to your computer and use it in GitHub Desktop.
Save ripper2hl/926489df2d13995abc3d57258e687514 to your computer and use it in GitHub Desktop.
Backup PostgreSQL database from a running Docker PostgreSQL container
docker exec container /usr/bin/pg_dump -U user --format=plain --no-owner --no-acl sepomex | sed -E 's/(DROP|CREATE|COMMENT ON) EXTENSION/-- \1 EXTENSION/g' > prod.sql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment