PostgreSQL (Destination)
Loads data into PostgreSQL tables.
Configuration
yaml
warehouse:
kind: postgres
database: analytics
schema: raw| Field | Default | Description |
|---|---|---|
database | (required) | PostgreSQL database name |
schema | public | Target schema |
CLI
bash
skippr connect warehouse postgres \
--database analytics \
--schema publicOr run without flags to be prompted interactively.
| Flag | Description |
|---|---|
--database | PostgreSQL database name |
--schema | Target schema (default: public) |
Config output
Running connect warehouse postgres writes the following to skippr.yaml:
yaml
warehouse:
kind: postgres
database: analytics
schema: publicAuthentication
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
bash
export POSTGRES_HOST="localhost"
export POSTGRES_USER="myuser"
export POSTGRES_PASSWORD="mypassword"Required permissions
The database user needs:
CREATEon the target database (for silver/gold schema creation)USAGEandCREATEon 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 |
CDC
PostgreSQL destination supports CDC with staging-table MERGE semantics. Skippr automatically creates _skippr_order_token columns and tombstone tables.
See CDC Destinations -- PostgreSQL for details.
