config.yml
databases: - name: my_postgres_db # Unique identifier for this connection type: postgres host: "localhost" # PostgreSQL server hostname or IP port: 5432 # PostgreSQL server port (default: 5432) user: "postgres" # Username for authentication password: <password> # Direct password (not recommended) password_var: "PG_PWD" # Environment variable containing password (recommended) database: "postgres" # Database name to connect to ssl_mode: "require" # SSL mode (disable, require, verify-ca, verify-full)
Prepare password environment variable
export PG_PWD=<your password>
.env
echo PG_PWD=<your password> >> .env
Add PostgreSQL configuration
databases: - name: local_pg type: postgres host: "localhost" port: 5432 user: "postgres" password_var: "PG_PWD" database: "myapp" ssl_mode: "disable"
psql -h localhost -U postgres -d mydb
/var/log/postgresql/postgresql-*.log
pg_hba.conf
pg_stat_*