dockerized postgres
May 22, 2022 ยท View on GitHub
You can use dockerized postgres to query your database, and manage backups, without locally installing postgres.
The commands work as usual, except:
- Use
host.docker.internalinstead oflocalhost. - You can only access files in the current working directory (e.g. when dumping).
psql
dockerized psql --host "host.docker.internal" --username <username>
pg_dumpall
dockerized pg_dumpall \
--host "host.docker.internal" \
--file "backup.sql" \
--username root \
--no-password \
--quote-all-identifiers \
--verbose