Stream Postgres changes via logical replication, or land changes into a Postgres table.
Postgres is a dual-direction connector. As a source it streams change data capture off the database’s logical replication: every insert, update, and delete becomes an ordered change row. As a sink it upserts those rows into a target table; because the upsert is idempotent, delivery is effectively-once.
Reads your Postgres logical-replication stream from a publication and a slot it owns.
Turns every insert, update, and delete into a change row, in commit order.
Routes each row to any sink you configure, ordered per key.
One connector: use Postgres as a CDC source or an upsert sink.
Run it inside the Zipline runtime or as an external process.
Effectively-once delivery, safe to retry, upserts never double-apply.
source:
type: postgres
placement: external
config:
host: orders-db
port: 5432
database: orders
user: zipline
publication: zipline_pub
slot_name: zipline_orders
secret_refs:
- { field: password, ref: orders_db_password } source config
| Field | Type | Default | Req | Description |
|---|---|---|---|---|
| host | string | - | req | Postgres host to connect to. |
| port | int | - | req | Postgres port. |
| database | string | - | req | Database name. |
| user | string | - | req | Connecting user. |
| password | string | - | req secret | Connecting user’s password. |
| publication | string | - | req | Publication to read changes from. |
| slot_name | string | - | req | Replication slot to read from. |
| ssl_mode | string | prefer | opt | TLS mode for the connection. |
sink config
| Field | Type | Default | Req | Description |
|---|---|---|---|---|
| host | string | - | req | Postgres host to connect to. |
| port | int | 5432 | opt | Postgres port. |
| database | string | - | req | Database name. |
| user | string | - | req | Connecting user. |
| password | string | - | opt secret | Connecting user’s password. |
| ssl_mode | string | prefer | opt | TLS mode for the connection. |
The sink upserts into a table and primary key that already exist in the destination - Zipline does not create schema.
Follow the first-pipeline guide to wire Postgres into a running pipeline, or jump to the full config reference above.