Overview
The OLake Go Postgres Source connector supports multiple synchronization modes. It offers features like parallel chunking, checkpointing, and automatic resume for failed full loads. This connector can be used within the OLake UI or run locally via Docker for open-source workflows.
Tested, step-by-step guides take Postgres to Apache Iceberg, Snowflake, Databricks, BigQuery, Redshift, ClickHouse and DuckDB, each from a pipeline that was run end to end.
Sync Modes Supported
- Full Refresh
- Full Refresh + CDC
- CDC Only
- Full Refresh + Incremental
OLake Go reads changes through the native pgoutput plugin. The older wal2json-based CDC method is no longer supported.
Prerequisites
Version Prerequisites
A Postgres server version 10 or above is required.
CDC Prerequisite
To set up PostgreSQL, follow the appropriate setup guide for your PostgreSQL environment:
- Aurora Postgres – CDC Setup Guide
- Amazon RDS Postgres – CDC Setup Guide
- Postgres via Docker Compose – Local Setup
- Azure Database for Postgres – CDC Setup Guide
- Google Cloud SQL for Postgres – CDC Setup Guide
- Generic Postgres – CDC Setup Guide
Connection Prerequisites
- Read access to the tables for the PostgreSQL user.
- For Supabase related setup, refer the Connecting to Supabase section.
After initial Prerequisites are fulfilled, the configurations for PostgreSQL can be configured.
Configuration
- Use OLake UI for Postgres
- Use OLake CLI for Postgres
1. Navigate to the Source Configuration Page
- Complete the OLake UI Setup Guide
- After logging in to the OLake UI, select the
Sourcestab from the left sidebar. - Click
Create Sourceon the top right corner. - Select Postgres from the connector dropdown
- Provide a name for this source.
2. Provide Configuration Details
-
Enter Postgres credentials.

Change data capture (CDC)
| Field | Description | Example Value |
|---|---|---|
| Enable CDC | Enables change data capture to sync like inserts, updates, and deletes. When enabled, CDC-specific fields appear below. When disabled, supports only Full Refresh and Incremental sync modes. | Enabled (default) |
Replication Slot required for CDC | Logical replication slot (pgoutput) that retains WAL segments until read, ensuring consistent CDC. | olake-repl-slot |
Publication required for CDC | Name of the PostgreSQL publication that defines which tables and operations (INSERT, UPDATE, DELETE, TRUNCATE) to replicate. Must exist in the same database as the replication slot and include all tables for CDC capture. | postgres_pub |
| Initial Wait Time | Idle timeout in seconds for pgoutput log reading. Default: 10800 (3 hours) and the minimum is 120. A lower value falls back to the default. | 120 |
| Preserve TOAST Values | When an UPDATE operation leaves a TOAST column unchanged, Postgres omits it. OLake Go writes __olake_unavailable_value__ for that column. With the toggle ON, OLake Go reads that record's previous value from the Iceberg destination and writes that value instead, so the unchanged column still shows its last real value. | Off (Default) |
- Requires the OLake Go Postgres source v1.2.0 or later and OLake UI v0.9.3 or later.
- Preserve TOAST Values can only be set when creating the source and cannot be changed afterwards.
- When enabled, the available update types are restricted to Positional Deletes (
pos) and Deletion Vectors (dv).
Connection details
| Field | Description | Example Value |
|---|---|---|
Postgres Host required | Hostname or IP address of the Postgres database server. | pg-host |
Postgres Port required | TCP port on which the Postgres listener is accepting connections. | 5432 |
Database Name required | The name of the target database to connect to. | olake-db |
Username required | Database user used to authenticate the connection. | pg-user |
Password required | The password corresponding to the provided username for authentication. | pgpwd |
| Schemas | List of schemas for discovery. Helps avoid reading all schemas by limiting discovery to only the specified ones. When omitted, all accessible non-system schemas are discovered. | public,analytics |
| JDBC URL Parameters | Extra JDBC URL parameters for fine-tuning the connection. | {"connect_timeout":"20"} |
| SSL Mode | Defines whether the connection to the database is encrypted over TLS/SSL. Needed to meet security requirements and connect to databases that do not allow plain-text traffic. |
|
| Certificate Input | Defines how TLS/SSL certificates are provided. Paste the PEM content, or give the file path of each certificate. For Certificate File Path, mount the files first: Docker Compose or Kubernetes. The three certificate fields below must all use the same method. |
|
| Server CA Certificate or Server CA Certificate Path | CA certificate for server verification.
| Inline: <PEM content> Path: /etc/ssl/custom-certs/ca.pem |
| Client Certificate or Client Certificate Path | Client certificate for mutual TLS authentication. Set together with Client Key.
| Inline: <PEM content> Path: /etc/ssl/custom-certs/client.pem |
| Client Key or Client Key Path | Client private key for mutual TLS authentication.
| Inline: <PEM content> Path: /etc/ssl/custom-certs/client.key |
Additional configuration
| Field | Description | Example Value |
|---|---|---|
| Max Threads | Maximum number of worker threads the connector can spin up for parallel tasks. | 10 |
| Retry Count | Number of retry attempts for transient failures during connection or sync operations. | 3 |
| SSH Config | Configure OLake Go to connect through an SSH tunnel. |
|
Do not reuse the same replication slot and publication across multiple OLake Go jobs. Sharing them will result in data loss and inconsistencies.
3. Test Connection
-
Click Set up source to validate the configuration. The test performs two checks:

-
Connection validation: Verifies that OLake Go can reach the Postgres server using the provided host, port, credentials, and SSL settings.
-
CDC prerequisites validation (when CDC is enabled): Evaluates required server-side settings to ensure reliable CDC operation:
wal_level: Must be set tologicalreplication_privilege: User must have replication privilegesreplication_slot: The specified replication slot must existpublication: The specified publication must exist and include the required tables
-
-
If any required check fails, the test connection will show the current and recommended values. Fix the server-side settings and retry the connection.
-
If all checks pass, the Postgres source is created successfully. Jobs can then be configured using this source.
-
In case of connection failure, refer to the Troubleshooting section.
1. Create Configuration File
- Once the OLake CLI is setup, create a folder to store configuration files such as
source.jsonanddestination.json.
The source.json file for postgres must contain these mandatory fields.
2. Provide Configuration Details
An example source.json file will look like this:
{
"host": "localhost",
"port": 5432,
"database": "main",
"username": "main",
"password": "password",
"jdbc_url_params": {"connect_timeout":"20"},
"retry_count": 3,
"schemas": ["public", "analytics"],
"ssl": {
"mode": "disable"
},
"update_method": {
"replication_slot": "postgres_slot",
"publication": "postgres_pub",
"initial_wait_time": 120,
"preserve_toast_values": false
},
"max_threads": 5,
"ssh_config": {
"host": "my-tunnel-host",
"port": 22,
"username": "my-tunnel-user",
"password": "tunnel-password"
}
}
| Field | Description | Example Value | Type |
|---|---|---|---|
host required | Hostname or IP address of the Postgres database server. | "pg-host" | STRING |
port required | TCP port on which the Postgres listener is accepting connections. | 5432 | INTEGER |
database required | The name of the target database to connect to. | "olake-db" | STRING |
password required | The password corresponding to the provided username for authentication. | "pgpwd" | STRING |
username required | Database user used to authenticate the connection. | "pg-user" | STRING |
update_method required for CDC | Required for CDC sync configuration | {"replication_slot": "postgres_slot", "publication": "postgres_pub", "initial_wait_time": 120} | OBJECT |
| initial_wait_time | Idle timeout in seconds for pgoutput log reading. Default: 10800 (3 hours) and the minimum is 120. A lower value falls back to the default. | 120 | INTEGER |
replication_slot required for CDC | Logical replication slot (pgoutput) that retains WAL segments until read, ensuring consistent CDC. | "olake-repl-slot" | STRING |
publication required for CDC | Name of the PostgreSQL publication that defines which tables and operations (INSERT, UPDATE, DELETE, TRUNCATE) to replicate. Must exist in the same database as the replication slot and include all tables for CDC capture. | "postgres_pub" | STRING |
| preserve_toast_values | When an UPDATE operation leaves a TOAST column unchanged, Postgres omits it. OLake Go writes __olake_unavailable_value__ for that column. With the value set as true, OLake Go reads that record's previous value from the Iceberg destination and writes that value instead, so the unchanged column still shows its last real value. | false | BOOLEAN |
| Schemas | Comma-separated list of schemas for discovery. Helps avoid reading all schemas by limiting discovery to only the specified ones. When omitted, all accessible non-system schemas are discovered. | [public,analytics] | STRING [] |
| max_threads | Maximum number of worker threads the connector can spin up for parallel tasks. | 10 | INTEGER |
| retry_count | Number of times the retry will take place incase of timeout before failing the sync. | 3 | INTEGER |
| jdbc_url_params | Extra JDBC URL parameters for fine-tuning the connection. | {"connect_timeout":"20"} | OBJECT |
| ssl* | Defines whether the connection to the database is encrypted over TLS/SSL. Needed to meet security requirements and connect to databases that do not allow plain-text traffic. |
| OBJECT |
| ssl.cert_source | Defines how TLS/SSL certificates are provided: inline (default) for PEM content, or path for file paths. For path, mount the files first: Docker CLI. The three certificate parameters below must all use the same method. |
| STRING |
| ssl.server_ca or ssl.server_ca_path | CA certificate for server verification.
| Inline: "<Inline PEM Content>" Path: "/etc/ssl/custom-certs/ca.pem" | STRING |
| ssl.client_cert or ssl.client_cert_path | Client certificate for mutual TLS authentication. Set together with the client key parameter.
| Inline: "<Inline PEM Content>" Path: "/etc/ssl/custom-certs/client.pem" | STRING |
| ssl.client_key or ssl.client_key_path | Client private key for mutual TLS authentication.
| Inline: "<Inline PEM Content>" Path: "/etc/ssl/custom-certs/client.key" | STRING |
| ssh_config | Configure OLake Go to connect through an SSH tunnel. | {"host": "my-tunnel-host", "port": 22 , "username": "my-tunnel-user", "password": "tunnel-password"} | OBJECT |
- Requires the OLake Go Postgres source v1.2.0 or later.
preserve_toast_valuescan only be set before running the firstdiscoverand cannot be changed afterwards.- Enabling
preserve_toast_valuesrestricts theavailable_update_typesfield in discovered streams toposanddv.
* See SSL Mode Details below for supported modes and example configurations. The following SSL modes are supported: No TLS/SSL encryption. Suitable for databases that allow plain-text connections. Example Configuration: Encrypted connection without certificate verification. Example Configuration: Encrypted connection with CA certificate verification. Encrypted connection with CA and hostname verification. SSL Mode Details
SSL Mode
1. Disable
disable2. Require
require3. Verify-CA
verify-caserver_caclient_cert, client_keycert_source, server_ca_pathclient_cert_path, client_key_path4. Verify-Full
verify-fullserver_caclient_cert, client_keycert_source, server_ca_pathclient_cert_path, client_key_path
Similarly, destination.json file can be created inside this folder. For more information, see destination documentation.
3. Check Source Connection
To verify the database connection following command needs to be run:
docker run --pull=always \
-v "[PATH_OF_CONFIG_FOLDER]:/mnt/config" \
olakego/source-postgres:latest \
check \
--config /mnt/config/source.json
-
The
checkcommand runs two validations:-
Connection validation: Verifies that OLake Go can reach the Postgres server using the settings in
source.json(host, port, credentials, and SSL settings). -
CDC prerequisites validation (when CDC is configured via
update_method): Evaluates required server-side settings to ensure reliable CDC operation:wal_level: Must be set tologicalreplication_privilege: User must have replication privilegesreplication_slot: The specified replication slot must existpublication: The specified publication must exist and include the required tables
-
-
If all checks pass, OLake Go returns a connection status payload that includes each prerequisite check and
status: SUCCEEDED. For example:json{"connectionStatus": {"prerequisites": [{"current_value": "logical","description": "Without logical WAL, Postgres cannot stream row changes.","name": "wal_level","passed": true,"recommended_value": "logical","required": true},{"current_value": "granted","description": "The user cannot open a replication connection, so no changes can be read.","name": "replication_privilege","passed": true,"recommended_value": "REPLICATION (RDS/Aurora: rds_replication)","required": true},{"current_value": "exists","description": "The configured replication slot is missing or unusable, so there is no change stream to read.","name": "replication_slot","passed": true,"recommended_value": "logical slot in this database","required": true},{"current_value": "exists","description": "The configured publication does not exist, so no changes are published to OLake.","name": "publication","passed": true,"recommended_value": "exists","required": true}],"status": "SUCCEEDED"},"type": "CONNECTION_STATUS"} -
If a required CDC prerequisite check fails, the response includes the current and recommended values for the failing settings. Update the server configuration and run
checkagain. -
In case of connection failure, refer to the Troubleshooting section.
Preserving TOAST Values
When It Works
| Setup | Large values kept? |
|---|---|
| Sync Mode | CDC and Strict CDC only. Full refresh and incremental read whole rows, so TOAST preservation is not needed. Note: For Strict CDC inserts are read back from the destination, but updates to non-TOAST columns may still write __olake_unavailable_value__ for unchanged TOAST columns. |
| Stream in append mode | No, there is no prior row to read back from |
Table with REPLICA IDENTITY FULL | Not needed, Postgres sends the full row |
wal2json plugin | Not supported (deprecated) |
When Preserve TOAST Values is enabled, syncs may take longer. For each update that leaves a large column unchanged, OLake reads the previous value from the destination.
The OLake UI disables this field once the source is created. The CLI does not enforce this. source.json stays editable and OLake will not block the change. Changing it after syncs have run causes data discrepancies:
- Turning it on later: values synced earlier already hold
__olake_unavailable_value__in the destination, so turning it on will not bring back the intended value. - Turning it off later: updates from then on write the placeholder again. Values that were already kept stay as they are.
- Upgrading an existing source's connector version: the toggle stays at whatever value it was set to and does not reset. To start preserving TOAST values for a source that was created with it off, create a new source instead of upgrading.
Data Type Mapping
| PostgreSQL Data Types | Destination Data Type |
|---|---|
| int, int2, int4, smallint, integer, serial, serial2, serial4 | int |
| bigint, bigserial, int8, serial8 | bigint |
| float, float4, real | float |
| numeric(p,s), decimal(p,s) with p up to 38 | decimal(p,s) |
| numeric(p,s) with a negative scale, such as numeric(10,-2) | decimal(p-s,0), such as decimal(12,0) |
| numeric(p,s) with a scale above the precision | decimal(s,s) |
| numeric without a precision, numeric(39-1000,s), and a negative scale whose whole numbers pass 38 digits, such as numeric(38,-5) | double |
| double precision, float8 | double |
| boolean | boolean |
| date, timestamp without time zone, timestamp with time zone | timestamptz |
| money, box, bpchar, char, character, character varying, json, jsonb, jsonpath, name, numrange, path, text, tid, tsquery, tsrange, tstzrange, uuid, varbit, varchar, xml, inet, bit, int2vector, daterange, time with time zone, time without time zone | string |
- New jobs: jobs created on OLake Go v1.2.0 and above land these columns as
decimal(p,s). - Existing jobs: jobs created on an older version keep these columns as
double. To switch them todecimal(p,s), upgrade to OLake Go v1.2.0 and above and run Clear Destination. Upgrading OLake Go alone does not convert a column that already lands asdouble. - A destination decimal holds at most 38 digits, because Iceberg and Spark hold no wider decimal. A scale of 0 still maps to a decimal, so
NUMERIC(10)becomesdecimal(10,0). - Columns that land as
doublekeep about 17 significant digits, so wider values round. - If a
doublecolumn is part of the primary key, keys that differ only past about 17 significant digits get the same_olake_idand replace each other in upsert mode. - Decimal columns keep every digit when used as a cursor field, in a data filter or in the primary key's
_olake_id.
- A
numericcolumn can holdNaN, which adecimalcolumn cannot. OLake Go writes it as null and logs one warning for the sync. - OLake Go always ingests timestamp data in UTC format, independent of the source timezone.
Date and Time Handling
During transfer, values in date, time, and timestamp columns are modified to ensure valid calendar ranges and destination compatibility.
- Case I (Year 0000):
Source dates with year0000are not valid in most destinations, so we change them to the epoch start date.
Example:0000-05-10 → 1970-01-01 - Case II (Year > 9999):
Extremely large years are capped at9999. The month and date are not affected.
Examples:10000-03-12 → 9999-03-12 - Case III (Invalid month/day):
When the month or day exceeds valid ranges (i.e. month > 12 or day > 31), or the combined date is invalid, the value is replaced with the epoch start date.
Examples:2024-13-15 → 1970-01-01,2023-04-31 → 1970-01-01
These rules apply to date, time, and timestamp columns during transfer.
Troubleshooting
1. No encryption (SQLSTATE 28000)
FATAL failed to ping database: failed to connect to `host=product-team-testing.postgres.database.azure.com user=product_team database=postgres`: server error (FATAL: no p
g_hba.conf entry for host "4.240.65.100", user "product_team", database "postgres", no encryption (SQLSTATE 28000))
Solution: Change the ssl.mode: disable to ssl.mode: allow to resolve this issue. This is a known issue with Azure Postgres and the solution is to set the ssl.mode to allow in the connection string.
2. Connecting to Supabase
OLake Go can connect seamlessly to Supabase Postgres databases using any of the three connection modes that Supabase provides:
-
Direct Connection – Connects directly to the Postgres instance.
Note: By default, Supabase's direct connection supports only IPv6. IPv4 support can be enabled via the paid IPv4 add-on. -
Transaction Pooler – Uses PgBouncer in transaction pooling mode. Suitable for most use cases that do not require session-level features.
-
Session Pooler – Recommended when the client network supports only IPv4. In this mode, each client gets a dedicated database session.
The Direct Connection mode is required for CDC (Change Data Capture) operations, as Supabase permits replication slot creation only when connecting directly to the Postgres instance.
IP Version Compatibility
OLake Go fully supports both IPv4 and IPv6 connections. However, Supabase’s IP compatibility depends on the connection mode and account configuration.
To check your machine or cloud environment’s IP version, you can run:
curl -6 https://ifconfig.co/ip
The format of the returned address indicates the IP version:
- Addresses with four decimal numbers (0–255) separated by dots (.), for example
192.168.1.1, indicate IPv4. - Addresses containing hexadecimal segments separated by colons (:), such as
2404:6800:4007:821::200e, indicate IPv6.
Docker IPv6 Support
By default, Docker containers support only IPv4, which may block access to Supabase’s Direct Connection if IPv6 is required. IPv6 can be enabled as follows:
- Open the Docker Desktop Dashboard.
- Click the Settings icon (⚙️) in the top-right corner.
- Select Docker Engine from the left-hand sidebar.
- In the JSON configuration editor, add the following line
"ipv6":true
- Click Apply & Restart to save the changes and restart Docker.
RLS (Row-Level Security) Considerations
When using a read-only database role for syncing with OLake Go, ensure that Row-Level Security (RLS) is either disabled or properly configured. If RLS policies restrict access, sync operations may complete without error but result in zero rows being replicated.
To allow a specific role to bypass RLS entirely, execute the following command (replace <rolename> with the actual role name):
ALTER USER <rolename> WITH BYPASSRLS;
3. Failed with non retryable error: LSN not updated after X mins
Failed with non retryable error: LSN not updated after `X` mins
This issue occurs when wal_sender_timeout is set too low (for example, 30s). If CDC processing takes longer than that, PostgreSQL closes the replication connection before LSN acknowledgment is completed.
It is more likely to happen on databases with concurrent writes or heavier CDC load.
Solution: Set wal_sender_timeout to 0 (recommended) or a sufficiently large value.
4. Delete Records Only Retain the Primary Key
By default, WAL only includes the primary key on deletes. In OLake Go, delete records (_op_type = 'd') will therefore only retain the primary key and OLake Go metadata columns and other columns appear blank or null.
Solution: To retain the full row values for deleted records, run the following on the affected table:
ALTER TABLE <table_name> REPLICA IDENTITY FULL;
5. TOAST Columns Show __olake_unavailable_value__ After an Update
When an UPDATE changes other columns but not a large (TOAST) column, Postgres doesn't send the TOAST column's value. OLake Go writes __olake_unavailable_value__ for it.
Solution: Use either of these:
- Turn on Preserve TOAST Values when creating the source.
- Run the following on the affected table. Postgres then sends the full row, at the cost of more WAL:
ALTER TABLE <table_name> REPLICA IDENTITY FULL;
If the issue is not listed here, post the query on Slack to get it resolved within a few hours.
Changelog
| Date of Release | Version | Description |
|---|---|---|
| 27 August 2025 | 0.1.11 | override default timeout in Discover |