PostgreSQL source
tap-postgres extracts tables with full-table, key-based incremental, or
wal2json logical replication.
Source |
Status |
Native transfer |
|---|---|---|
PostgreSQL |
Available |
FullSync to PostgreSQL or Snowflake; PartialSync to Snowflake |
Prerequisites
The runtime user needs CONNECT on the database, USAGE on each source
schema, and SELECT on replicated tables. Grant default privileges if future
tables must be discovered automatically.
LOG_BASED replication also requires:
a connection to the writable primary;
wal_level=logicaland sufficientmax_replication_slotsandmax_wal_senderscapacity;the wal2json plugin with format version 2 support; and
permission to create and consume a logical replication slot.
PipelineWise creates one slot for the tap database. PostgreSQL retains WAL needed by that slot, so monitor retained WAL and do not remove the slot while the tap is active.
Configuration
id: "orders"
name: "Orders PostgreSQL"
type: "tap-postgres"
owner: "data-platform@example.com"
db_conn:
host: "<HOST>"
port: 5432
user: "<USER>"
password: "{{ env_var['POSTGRES_PASSWORD'] }}"
dbname: "orders"
target: "snowflake"
batch_size_rows: 20000
stream_buffer_size: 0
schemas:
- source_schema: "public"
target_schema: "repl_orders"
tables:
- table_name: "payments"
replication_method: "LOG_BASED"
Setting |
Required |
Default |
Effect |
|---|---|---|---|
|
No |
Primary host |
Offloads FastSync reads; logical replication remains on the primary. |
|
No |
All visible schemas |
Limits discovery to a comma-separated schema list. |
|
No |
|
Stops a logical replication run after this duration. |
|
No |
|
Stops after this total idle polling period. |
|
No |
|
Stops after reaching the WAL boundary captured at startup. |
|
No |
Connector default |
Uses PostgreSQL |
|
No |
Unlimited |
Bounds rows returned by an incremental query. |
|
No |
CPU count |
Controls concurrent FastSync table exports. |
Common tap settings are documented in YAML configuration. Generate the
full template with pipelinewise init.
Acknowledgement and recovery
Consuming WAL does not by itself advance the slot’s safe flush position.
PipelineWise sends feedback only up to the minimum target-acknowledged LSN stored
in state.json. Missing, unreadable, invalid, or regressing state retains the
previous safe LSN.
Before consuming ongoing LOG_BASED WAL on PostgreSQL 9.6 or later, PipelineWise
attempts to emit a transactional pg_logical_emit_message in each tap
database when the tap user can execute the function. The transaction’s commit
provides a decodable bookmark boundary even when the selected tables are idle.
Slot feedback advances through that boundary only after the target acknowledges
the state.
If the function is unavailable or inaccessible, replication continues using the captured current-WAL boundary. Fully filtered idle WAL may then require a later decodable message before the bookmark and acknowledgement can advance.
After an unexpected termination, restart the same tap without advancing state. Unacknowledged WAL remains replayable while the slot exists. Resync only when the slot or required WAL is unavailable, and monitor retained WAL during a prolonged target outage. See Stream buffering and acknowledgement and Troubleshooting.