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.internal
instead oflocalhost
. - You can only access files in the current working directory (e.g. when dumping).
dockerized psql --host "host.docker.internal" --username <username>
dockerized pg_dumpall \
--host "host.docker.internal" \
--file "backup.sql" \
--username root \
--no-password \
--quote-all-identifiers \
--verbose