Skip to content

PostgreSQL (Source)

Reads data from PostgreSQL tables.

Configuration

yaml
source:
  kind: postgres
  host: localhost
  port: 5432
  user: postgres
  password: ${POSTGRES_PASSWORD}
  database: mydb
FieldDefaultDescription
hostlocalhostPostgres host
port5432Postgres port
userpostgresUsername
passwordPassword
databaseDatabase name
connection_stringFull connection string (overrides individual fields)
tables(auto-discover)Optional list of tables to read
queryCustom SQL query (overrides tables)
batch_size_rows10000Rows per ingest batch

Namespace: postgres.{table_name}

CLI

bash
skippr connect source postgres-source \
  --host localhost --port 5432 \
  --user myuser --password mypass \
  --database mydb \
  --tables public.customers,public.orders
FlagDescription
--hostPostgres host
--portPostgres port (default: 5432)
--userUsername
--passwordPassword
--databaseDatabase name
--connection-stringFull connection string (overrides individual fields)
--tablesComma-separated list of tables
--querySQL query instead of table list

Authentication

VariableDefaultDescription
POSTGRES_HOSTlocalhostPostgreSQL host
POSTGRES_PORT5432PostgreSQL port
POSTGRES_USERDatabase user
POSTGRES_PASSWORDDatabase password
POSTGRES_SSLMODESSL mode (e.g. disable, require, prefer)

Troubleshooting

SymptomFix
connection refusedCheck POSTGRES_HOST and POSTGRES_PORT are correct and the server is running
password authentication failedVerify POSTGRES_USER and POSTGRES_PASSWORD
SSL errorsSet POSTGRES_SSLMODE=disable for local development

CDC

PostgreSQL supports real-time Change Data Capture via WAL logical replication. Add cdc_enabled: true to the source config and configure a pipeline cdc: block.

See CDC Sources -- PostgreSQL for prerequisites, configuration, and resume behavior.