A collection of PostgreSQL scripts for automating common DBA tasks in a Docker-centric way.
Documentation for each subcommand:
- create-user-db
- delete-user-db
- create-readonly-user
- save
- load
- vacuum
- vacuum-full-analyze
- vacuum-full-freeze-analyze
- psql
Using Docker links to postgres
container. This will display the usage information:
docker run --rm -i -t --link myserver:postgres docker.io/panubo/postgres-toolbox
To run the subcommand:
docker run --rm -i -t --link myserver:postgres docker.io/panubo/postgres-toolbox <subcommand>
Use --link <postgres container name>:postgres
to automatically specify the required variables.
Or alternatively specify the environment variables:
DATABASE_HOST
= IP / hostname of PostgreSQL server.DATABASE_PORT
= TCP Port of PostgreSQL service.DATABASE_USER
= Administrative user eg postgres with SUPERUSER privileges.DATABASE_PASS
= Password of administrative user.
Some subcommands require additional environment parameters.
Feature incomplete. Work in progress.