Getting Started¶
Requirements¶
- Postgres 15+ with
wal_level=logical - User with
REPLICATIONprivilege
Check your setting:
Enable if needed (requires restart):
Configure¶
Create config.yaml:
stream:
id: 1
pg_connection:
host: localhost
port: 5432
name: mydb
username: postgres
password: postgres
tls:
enabled: false
batch:
max_size: 1000
max_fill_secs: 5
sink:
type: webhook
url: https://httpbin.org/post
Run¶
Each sink has its own image: kafka-latest, nats-latest, sqs-latest, etc.
Create a Subscription¶
INSERT INTO pgstream.subscriptions (key, stream_id, operation, schema_name, table_name)
VALUES ('user-created', 1, 'INSERT', 'public', 'users');
Now inserts into users are streamed to your webhook.
Next Steps¶
- Subscriptions - Filter events, select columns
- Sinks - Configure your destination
- Configuration Reference - All options