Backup your databases
docker exec -t your-db-container pg_dumpall -c -U postgres > dump_`date +%d-%m-%Y"_"%H_%M_%S`.sql
Restore your databases
cat your_dump.sql | docker exec -i your-db-container psql -U postgres
More Related Contents:
- Starting and populating a Postgres container in Docker
- Keep PostgreSQL from sometimes choosing a bad query plan
- Copying PostgreSQL database to another server
- Primary keys with Apache Spark
- How do I backup a database file to the SD card on Android?
- How can I put a database under git (version control)?
- How do IMMUTABLE, STABLE and VOLATILE keywords effect behaviour of function?
- Store query result in a variable using in PL/pgSQL
- Can I rollback a transaction I’ve already committed? (data loss)
- Kill a postgresql session/connection
- How to backup sqlite database?
- PostgreSQL: Drop PostgreSQL database through command line [closed]
- Do stored procedures run in database transaction in Postgres?
- Import SQL dump into PostgreSQL database
- how to use Blob datatype in Postgres
- How can I solve Postgresql SCRAM authentication problem?
- Convert SQLITE SQL dump file to POSTGRESQL
- Is it better to use multiple databases with one schema each, or one database with multiple schemas? [closed]
- How to login and authenticate to Postgresql after a fresh install?
- PostgreSQL Database Log Transaction
- Connect to a heroku database with pgadmin
- How do I automatically update a timestamp in PostgreSQL
- Adding a new value to an existing ENUM Type
- How can I import a .sql file into my Heroku postgres database?
- Should each and every table have a primary key?
- When and why are database joins expensive?
- Error: pg_config executable not found when installing psycopg2 on Alpine in Docker
- XML data to PostgreSQL database [closed]
- Best representation of an ordered list in a database?
- SQL LIKE operator in Cloud Firestore?