Skip to content

Connect: Postgres

Command

skippr connect warehouse postgres \
  --database analytics \
  --schema public

Or run without flags to be prompted interactively.

Flags

Flag Description
--database PostgreSQL database name
--schema Target schema (default: public)

Config output

Running connect warehouse postgres writes the following to skippr.yaml:

warehouse:
  kind: postgres
  database: analytics
  schema: public

Authentication

Authentication uses environment variables. Credentials are never stored in the config file.

Variable Default Description
POSTGRES_HOST localhost PostgreSQL host
POSTGRES_PORT 5432 PostgreSQL port
POSTGRES_USER Database user
POSTGRES_PASSWORD Database password
POSTGRES_DATABASE Database name (overrides config file)
POSTGRES_SCHEMA public Target schema (overrides config file)
POSTGRES_SSLMODE SSL mode (e.g. disable, require, prefer)

Example

export POSTGRES_HOST="localhost"
export POSTGRES_USER="myuser"
export POSTGRES_PASSWORD="mypassword"

Required permissions

The database user needs:

  • CREATE on the target database (for silver/gold schema creation)
  • USAGE and CREATE on the target schema (for loading data)
  • Ability to create tables and insert data

Troubleshooting

Symptom Fix
connection refused Check POSTGRES_HOST and POSTGRES_PORT are correct and the server is running
password authentication failed Verify POSTGRES_USER and POSTGRES_PASSWORD
database "..." does not exist Create the database first, or check the database field in config
SSL errors Set POSTGRES_SSLMODE=disable for local development