Postgres to Databricks: CDC via Apache Iceberg
Postgres to Databricks usually means Lakeflow Connect, a Debezium and Kafka pipeline, or nightly exports picked up by Auto Loader. This guide takes a different route. OLake Go reads the Postgres write-ahead log through logical replication and commits the changes as Apache Iceberg tables into Unity Catalog.
The tables land as Unity Catalog managed Iceberg tables, with the files in the catalog's managed storage. Nothing else is in the path: no Kafka, no Spark job, no Databricks ingestion pipeline. DuckDB and Spark read the same tables through the same catalog.
Key takeaways
- OLake Go replicates Postgres into Databricks as Iceberg tables: a full historical snapshot first, then change data capture (CDC) from the write-ahead log, with no Kafka or Spark in between.
- The tables are Unity Catalog managed Iceberg tables. You query them from the Databricks SQL editor or a notebook right away, with no external table and no refresh.
- The same tables, written once by OLake Go, are also queryable from DuckDB and Spark through Unity Catalog. In the run on this page all three engines returned identical rows.
The short answer. To replicate Postgres to Databricks with change data capture (CDC), run OLake Go with Postgres logical replication as the source and Unity Catalog as the Iceberg destination, with Databricks as a target query engine. The first sync copies each table in full (the historical snapshot), and every later sync replays inserts, updates and deletes from the write-ahead log. Databricks, DuckDB and Spark then query the same Iceberg tables, with no second copy.
How Postgres CDC reaches Databricks here
Two things happen in order, and OLake Go does both on its own. The first sync records the current write-ahead log (WAL) position, then reads each table in parallel chunks and writes Parquet data files: that is the historical load. Every later sync opens the replication slot at the saved position and replays the inserts, updates and deletes since.
Nothing made during the snapshot is lost, and there is no separate backfill job. An update or delete retires the old row with a deletion vector, a small bitmap per data file that marks the replaced positions.
Each sync ends with one commit to Unity Catalog. Databricks sees the new snapshot on its next query, and DuckDB and Spark see it on their next catalog load.
One thing to keep an eye on: the replication slot holds WAL on disk until OLake Go reads it. If the job is paused for a week, Postgres keeps a week of WAL. Set max_slot_wal_keep_size so a stalled slot is invalidated before the disk fills, and alert on pg_replication_slots.wal_status.
What you need
- Postgres 10 or later with logical replication (
wal_level = logical) and a user that can replicate. The tables on this page ran on Postgres 16. Hosted Postgres on Amazon Relational Database Service (RDS), Aurora, Azure or Cloud SQL works the same way; step 1 links each guide. - A Databricks workspace with Unity Catalog, a catalog with managed storage, and an admin who can turn on external data access and grant
EXTERNAL USE SCHEMA. The run on this page used a workspace on Google Cloud. - OLake UI from the Docker Compose install. The run on this page used OLake Go v1.1.0.
- Docker, and about 30 minutes.
Step 1: Prepare Postgres for CDC
Most readers point OLake Go at tables they already have. If you want to follow along with the exact data from this page, create these two tables first:
The two sample tables used on this page
CREATE TABLE customers (
id SERIAL PRIMARY KEY, name TEXT, email TEXT, city TEXT, tier TEXT,
created_at TIMESTAMPTZ DEFAULT now(), updated_at TIMESTAMPTZ DEFAULT now());
CREATE TABLE orders (
id SERIAL PRIMARY KEY, customer_id INT REFERENCES customers(id), product TEXT,
amount NUMERIC(10,2), status TEXT,
created_at TIMESTAMPTZ DEFAULT now(), updated_at TIMESTAMPTZ DEFAULT now());
-- Then insert whatever you like. This page started with 8 customers and 40 orders.
OLake Go reads changes through logical replication with the built-in pgoutput plugin (Postgres 10 and later). Four things must be in place on the database before the first sync.
| Setting | Value | Why it matters |
|---|---|---|
wal_level | logical | Without it Postgres writes no row images to the WAL (write-ahead log), so there is nothing to replicate. Changing it needs a restart. |
| Replication role | LOGIN REPLICATION plus SELECT on the tables | The first snapshot reads the tables; the change stream opens a replication connection. |
| Publication | one per OLake Go job, covering the synced tables | Tells Postgres which tables' changes to publish. |
| Replication slot | one per OLake Go job, plugin pgoutput | Keeps WAL segments until OLake Go has read them. |
-- 1. Logical replication. wal_level needs a restart (a parameter-group change on managed Postgres).
ALTER SYSTEM SET wal_level = 'logical';
ALTER SYSTEM SET max_replication_slots = 10;
ALTER SYSTEM SET max_wal_senders = 10;
ALTER SYSTEM SET wal_sender_timeout = 0; -- so a long first snapshot is not cut off
-- 2. A role for OLake Go
CREATE ROLE olake WITH LOGIN REPLICATION PASSWORD '<password>';
GRANT USAGE ON SCHEMA public TO olake;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO olake;
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO olake;
-- 3. A publication for the tables you sync, and a pgoutput slot
CREATE PUBLICATION olake_pub FOR TABLE customers, orders;
SELECT pg_create_logical_replication_slot('olake_slot', 'pgoutput');
Tables with a primary key need nothing more. A table without one needs ALTER TABLE <table> REPLICA IDENTITY FULL; so that its updates and deletes carry the old row.
Check the result before moving on:
SHOW wal_level; -- logical
SELECT slot_name, plugin, active FROM pg_replication_slots;
SELECT pubname, puballtables FROM pg_publication;
Managed Postgres sets wal_level through a parameter group or server setting rather than ALTER SYSTEM. Each flavour has its own guide:
| Where Postgres runs | Guide |
|---|---|
| Amazon RDS | RDS Postgres CDC setup |
| Amazon Aurora | Aurora Postgres CDC setup |
| Azure Database for PostgreSQL | Azure Postgres CDC setup |
| Google Cloud SQL | Cloud SQL Postgres CDC setup |
| Your own server or VM | Generic Postgres CDC setup |
| Docker, for a local test | Local Postgres with Docker Compose |
Two OLake Go jobs sharing a replication slot read each other's changes and both lose data. Create a separate slot and publication for every job.
Step 2: Set up Unity Catalog in Databricks
Databricks reads Iceberg tables through Unity Catalog, the catalog built into every Databricks workspace. OLake Go writes straight into it, so the tables become Unity Catalog managed Iceberg tables. They show up in Catalog Explorer and the SQL editor the moment a sync commits.
The files sit in the catalog's managed storage, which is backed by an external location in your own cloud account. DuckDB and Spark reach the same tables through the same Unity Catalog endpoint.
| Catalog | OLake Go writes | Databricks reads | Verified on this page |
|---|---|---|---|
| Unity Catalog | Yes | Yes: native: Unity Catalog managed Iceberg tables | Yes, end to end |
- Unity Catalog
Unity Catalog is the catalog built into every Databricks workspace. OLake Go writes to it through Unity Catalog's Iceberg REST (representational state transfer) endpoint at https://<workspace-url>/api/2.1/unity-catalog/iceberg-rest, and the tables it creates are Unity Catalog managed Iceberg tables. Databricks allows writes through this endpoint for managed Iceberg tables only (Databricks: access tables from Iceberg clients, checked 2026-10-30).
Four things must be in place in the workspace, once:
| Setting | Where | Why it matters |
|---|---|---|
| External data access on the metastore | Catalog, the gear icon, Metastore, then External data access | Without it the Iceberg REST endpoint refuses every client that is not Databricks itself. |
| A catalog with managed storage | Catalog, Create catalog, with a storage location backed by an external location | OLake Go creates one schema per job inside it. The catalog name is the warehouse value every client uses. |
EXTERNAL USE SCHEMA for the writing principal | On the catalog, so it covers the schemas OLake Go creates | Unity Catalog checks this privilege, on top of the usual ones, before it serves a table to an outside engine. |
| A personal access token or a service principal | Settings, Developer, Access tokens | OLake Go sends it as a bearer token on every catalog call. |
-- The catalog OLake Go writes into. Its managed storage holds the Iceberg files.
CREATE CATALOG IF NOT EXISTS lakehouse MANAGED LOCATION '<external location URL>/lakehouse';
-- What the writing principal needs: browse and create schemas, then read and write tables in them
GRANT USE CATALOG, CREATE SCHEMA ON CATALOG lakehouse TO `olake@example.com`;
GRANT USE SCHEMA, CREATE TABLE, SELECT, MODIFY ON CATALOG lakehouse TO `olake@example.com`;
GRANT EXTERNAL USE SCHEMA ON CATALOG lakehouse TO `olake@example.com`;
Granting on the catalog makes the privileges inherit to every schema OLake Go creates later. EXTERNAL USE SCHEMA is not part of ALL PRIVILEGES, and only the catalog owner can grant it (Databricks: Unity Catalog privileges, checked 2026-10-30). A service principal with OAuth machine-to-machine credentials is the better choice in production. The other authentication methods are on the Unity Catalog destination page.
Unity Catalog accepts updates to a managed Iceberg table only as copy-on-write files or as Iceberg v3 deletion vectors. It rejects equality delete files with Can not create a Path from a null string [ErrorCode: 2015]. Set Databricks as a target query engine on the job, and OLake Go writes deletion vectors from the first sync.
Step 3: Connect Postgres to OLake Go
- OLake UI
- OLake CLI
- In the OLake UI, open Sources and click Create Source. Pick Postgres as the connector, give the source a name and keep the OLake Go version on the latest release.
- Under Change data capture (CDC), leave Enable CDC on and enter the Replication Slot and Publication you created in step 1. The default Initial Wait Time is fine.
- Under Connection details, fill in the host, port, database name, username and password. Leave Schemas empty to discover every non-system schema, or list the ones you want.
- Click Set up source. OLake Go tests the connection, then checks the four CDC prerequisites (
wal_level, the replication privilege, the slot and the publication) and shows the current and recommended value for anything that fails.
Here is the source form from the run on this page. Postgres ran in another container, so the host is host.docker.internal; the slot and publication are the ones from step 1.
Set up source runs the connection test and the four CDC checks before anything is saved:
The full field reference, including SSL modes and SSH tunnels, is on the Postgres connector page.
Create source.json in your config folder. The update_method block is what turns CDC on:
{
"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
},
"max_threads": 5,
"ssh_config": {
"host": "my-tunnel-host",
"port": 22,
"username": "my-tunnel-user",
"password": "tunnel-password"
}
}
Then confirm OLake Go can reach the database:
docker run --pull=always \
-v "$PWD/config:/mnt/config" \
olakego/source-postgres:latest \
check --config /mnt/config/source.json
A working setup returns "status": "SUCCEEDED" together with a prerequisites list that reports wal_level, replication_privilege, replication_slot and publication as passed. A failed check names the setting and its recommended value. Every field is described on the Postgres connector page.
Step 4: Configure the Iceberg destination
- Unity Catalog
- OLake UI
- OLake CLI
- Open Destinations and click Create Destination.
- Pick Apache Iceberg as the connector and Unity as the catalog type.
- Choose Personal Access Token as the authentication type and fill in the fields below. The catalog name from the setup goes into the catalog field.
- Click Create. OLake Go calls the Unity Catalog endpoint with the token and saves the destination.

The run on this page wrote into a catalog called datazip, with a personal access token that expires after seven days. The snippets below use lakehouse; replace it with your catalog name.
Unity Configuration Parameters
| Parameter | Sample Value | Description |
|---|---|---|
REST Catalog URLrequired | https://1234567890123456.1.gcp.databricks.com/ | Databricks workspace URL with Unity Catalog REST API endpoint. Use your actual workspace URL. |
Authentication Typerequired | Personal Access Token | Authentication method OLake Go uses for Unity Catalog REST API requests. Set to match your workspace's authentication configuration. |
Unity Catalog Namerequired | workspace | Name of the catalog in Unity. |
Tokenrequired | dapi123456789... | Databricks Personal Access Token |
| Catalog Name | olake_iceberg | Name of the Iceberg catalog OLake Go registers tables under. Defaults to olake_iceberg if left empty. |
| Enable Arrow Writes | false | Writes data and delete files using Apache Arrow based writer and registers them in Iceberg. |
Create destination.json next to source.json:
{
"type": "ICEBERG",
"writer": {
"catalog_type": "unity",
"catalog_name": "olake_iceberg",
"rest_catalog_url": "https://<workspace-url>/api/2.1/unity-catalog/iceberg-rest",
"iceberg_s3_path": "lakehouse",
"rest_auth_type": "personal access token",
"token": "<personal access token>",
"arrow_writes": false
}
}
iceberg_s3_path holds the Unity Catalog catalog name, not a bucket path: Unity Catalog decides where the files go.
Unity Configuration Parameters
| Parameter | Sample Value | Description |
|---|---|---|
catalog_typerequired | unity | Defines the catalog type used by the writer. |
rest_catalog_urlrequired | https://1234567890123456.1.gcp.databricks.com/ | Databricks workspace URL with Unity Catalog REST API endpoint. Use your actual workspace URL. |
iceberg_s3_pathrequired | workspace | Name of the catalog in Unity. |
rest_auth_typerequired | Personal Access Token | Authentication method OLake Go uses for Unity Catalog REST API requests. Set to match your workspace's authentication configuration. |
tokenrequired | dapi123456789... | Databricks Personal Access Token |
| catalog_name | olake_iceberg | Name of the Iceberg catalog OLake Go registers tables under. Defaults to olake_iceberg if left empty. |
| arrow_writes | false | Writes data and delete files using Apache Arrow based writer and registers them in Iceberg. |
Step 5: Create the job and run the first sync
- OLake UI
- OLake CLI
- Open Jobs and click Create Job. Give it a name and a schedule. Every Day at a fixed hour, or a cron expression, both work; the schedule is how often the change stream is drained, not how often a full copy runs.
- Select the source and the destination you created.
- Under Advanced Settings, set Target Query Engines to Databricks, plus DuckDB and Apache Spark if they will read the tables too. OLake Go then resolves an Iceberg delete format every one of those engines can read, so you never pick one by hand.
- Click Next. OLake Go discovers the tables and opens the Streams page.
- Tick the tables to replicate. For each one, set the sync mode to Full Refresh + CDC and the ingestion mode to Upsert. Leave the Upsert Type as OLake Go resolved it (Deletion Vector in the run on this page).
- Click Create Job, then open the job's menu and choose Sync Now for the first run.
Three target query engines were set on this job, and Databricks narrows the delete formats to one: deletion vectors on Iceberg v3 tables. OLake Go sets that format on every stream, so there is nothing to pick.

Discover the tables, choose the streams, then sync:
docker run --pull=always \
-v "$PWD/config:/mnt/config" \
olakego/source-postgres:latest \
discover --config /mnt/config/source.json
discover writes two files: available_streams.json (every table it found, do not edit) and selected_streams.json (the tables you want and their settings). In selected_streams.json, set sync_mode to {props.cliSyncMode ?? 'cdc'} for each table and pick the delete format your readers can open:
{
"selected_streams": {
"public": [
{
"stream_name": "customers",
"sync_mode": "cdc",
"normalization": true,
"append_mode": false,
"update_type": "dv"
}
]
}
}
update_type accepts eq (equality deletes, the default), pos (positional deletes) and dv (deletion vectors). Positional deletes and deletion vectors keep a small index between runs, so give the container a persistent directory for it through OLAKE_INDEX_DB_DIR. The first sync runs without a state file; OLake Go writes one at the end of the run:
docker run --pull=always \
-v "$PWD/config:/mnt/config" \
-e OLAKE_INDEX_DB_DIR=/mnt/config/index-db \
olakego/source-postgres:latest \
sync \
--config /mnt/config/source.json \
--selected-streams /mnt/config/selected_streams.json \
--available-streams /mnt/config/available_streams.json \
--destination /mnt/config/destination.json
Every later run adds --state /mnt/config/state.json to the same command, which is how OLake Go knows to replay only the changes since the last run. The full selected_streams.json reference is on the Docker CLI page; the index directory is described under index DB setup.
On this page the first run copied 8 customers and 40 orders (48 records, 2.23 KB) and finished in 37 seconds, container start included. OLake Go names the Unity Catalog schema after the job, the source database and the source schema, so postgres_to_databricks on database shop produced postgres_to_databricks_shop_public. The Iceberg DB field at the top of the Streams page changes it before the first sync.
Step 6: Query the tables in Databricks
- Unity Catalog
There is no registration step. The schema and tables OLake Go committed through Unity Catalog are managed Iceberg tables in the catalog you configured, and the Databricks SQL editor or a notebook reads them by their three-part name.
-- What OLake Go created (schema = <job name>_<source database>[_<source schema>])
SHOW TABLES IN lakehouse.postgres_to_databricks_shop_public;
SELECT id, name, city, tier
FROM lakehouse.postgres_to_databricks_shop_public.customers
ORDER BY id;
SELECT status, count(*) AS n, round(sum(amount), 2) AS total
FROM lakehouse.postgres_to_databricks_shop_public.orders
GROUP BY status ORDER BY status;
Any SQL warehouse or cluster on a recent Databricks Runtime reads them; a 2X-Small serverless warehouse is enough for checks. DESCRIBE EXTENDED on a table shows the Iceberg provider and the deletion vectors in its properties.
OLake Go adds four columns to every table: _olake_id (a hash of the primary key), _op_type, _olake_timestamp and _cdc_timestamp. _op_type is r for a row from the first snapshot, c for an insert, u for an update and d for a delete. Filter them out of dashboards, or use them to see when a row last changed.
Postgres tables carry one more OLake Go column, _cdc_lsn, which holds the WAL position each changed row came from.
Step 7: Change rows in Postgres and sync again
To see the change path work, the run on this page made 12 changes in Postgres after the first sync:
INSERT INTO customers (name, email, city, tier) VALUES
('Maya Patel', 'maya@example.com', 'Pune', 'silver'),
('Lucas Silva', 'lucas@example.com', 'São Paulo', 'bronze');
INSERT INTO orders (customer_id, product, amount, status) VALUES
(9, 'Laptop', 1299.00, 'placed'), (9, 'Mouse', 25.50, 'placed'),
(10, 'Monitor', 349.99, 'placed'), (3, 'Keyboard', 89.00, 'placed'), (7, 'Webcam', 79.90, 'placed');
UPDATE customers SET tier = 'gold', updated_at = NOW() WHERE name = 'Liam Carter';
UPDATE customers SET city = 'Abu Dhabi', updated_at = NOW() WHERE name = 'Zara Ali';
UPDATE orders SET status = 'delivered', updated_at = NOW() WHERE id IN (1, 4, 7);
The second sync read 12 records (594 bytes) from the slot and finished in 28 seconds end to end. For customers that meant one new data file with 4 rows: 2 inserts plus the new versions of 2 updated rows. One deletion vector retires the 2 old versions.
OLake Go's commit report in the sync log shows it directly: addedDataFiles=1, addedRecords=4, addedDVs=1 and addedPositionalDeletes=2. The orders table has the same shape with 8 rows and 3 deleted positions, and the equality delete count stays at 0.

Databricks shows the result on the next query, with no refresh. Liam Carter is gold, Zara Ali moved to Abu Dhabi, and the two new customers are there. The _op_type column marks how each row arrived: r for the snapshot rows, c for the inserts and u for the updates.
Schema changes. When a column is added in Postgres, OLake Go adds it to the Iceberg table on the next sync and commits the new schema to Unity Catalog. Widening changes (int to bigint, float to double) are applied; narrowing or incompatible type changes fail the sync rather than corrupt the table. Full rules are on the schema evolution page.
Query the same tables from DuckDB and Spark
Nothing is exported, copied or refreshed. Both engines read the files OLake Go wrote, through the same Unity Catalog endpoint, with storage credentials vended by Databricks.
- DuckDB
- Apache Spark
DuckDB attaches the Unity Catalog catalog as an Iceberg REST catalog with the same token. With vended_credentials, Unity Catalog hands DuckDB short-lived storage credentials per table, so no cloud keys are configured on the DuckDB side.
INSTALL iceberg; LOAD iceberg;
INSTALL httpfs; LOAD httpfs;
CREATE SECRET unity (TYPE iceberg, TOKEN '<personal access token>');
ATTACH 'lakehouse' AS uc (
TYPE iceberg,
ENDPOINT 'https://<workspace-url>/api/2.1/unity-catalog/iceberg-rest',
SECRET unity,
ACCESS_DELEGATION_MODE 'vended_credentials'
);
SELECT id, name, city, tier
FROM uc.postgres_to_databricks_shop_public.customers
ORDER BY id;
DuckDB reads Iceberg v3 deletion vectors from duckdb-iceberg 1.5.3, so the rows match Databricks after every sync. The principal behind the token needs EXTERNAL USE SCHEMA, the same as OLake Go.
DuckDB 1.5.5 returned the same 10 customers and the same orders roll-up as Databricks in the run on this page.
Open source Spark reaches Unity Catalog as a plain Iceberg REST catalog. The warehouse is the catalog name, the token is a personal access token, and the X-Iceberg-Access-Delegation header asks Unity Catalog for short-lived storage credentials.
spark-sql \
--packages org.apache.iceberg:iceberg-spark-runtime-4.0_2.13:1.10.0,org.apache.iceberg:iceberg-gcp-bundle:1.10.0 \
--conf spark.sql.extensions=org.apache.iceberg.spark.extensions.IcebergSparkSessionExtensions \
--conf spark.sql.catalog.uc=org.apache.iceberg.spark.SparkCatalog \
--conf spark.sql.catalog.uc.type=rest \
--conf spark.sql.catalog.uc.uri=https://<workspace-url>/api/2.1/unity-catalog/iceberg-rest \
--conf spark.sql.catalog.uc.warehouse=lakehouse \
--conf spark.sql.catalog.uc.token=<personal access token> \
--conf spark.sql.catalog.uc.header.X-Iceberg-Access-Delegation=vended-credentials
SELECT id, name, city, tier FROM uc.postgres_to_databricks_shop_public.customers ORDER BY id;
Iceberg 1.8 or later reads the v3 deletion vectors OLake Go writes for Databricks; this page was tested with 1.10.0 on Spark 4.0.1. Swap iceberg-gcp-bundle for iceberg-aws-bundle or iceberg-azure-bundle to match the cloud the workspace runs on.
Spark 4.0.1 with Iceberg 1.10.0 returned the same 10 customers and the same orders roll-up as Databricks and DuckDB in the run on this page.
An orders roll-up matched Postgres to the cent in all three engines. It gave 16 delivered orders for 8659.68, 18 placed for 10522.26, 11 shipped for 6397.25.
Data types: Postgres to Iceberg to Databricks
OLake Go maps Postgres types to Iceberg types, and Databricks maps Iceberg types to its own. Most columns pass through unchanged; decimals and timestamps are the ones to know.
| Postgres | Iceberg (written by OLake Go) | Databricks shows | Notes |
|---|---|---|---|
int, serial, smallint | int | INT | The id and customer_id columns on this page arrived as INT. |
bigint, bigserial | long | BIGINT | |
numeric, decimal, real, float4 | double | DOUBLE | The orders.amount sums on this page matched Postgres to the cent; round at query time when you need exact decimal arithmetic. |
double precision | double | DOUBLE | |
boolean | boolean | BOOLEAN | |
date, timestamp, timestamptz | timestamptz (UTC) | TIMESTAMP | date gains a midnight UTC time. Timestamps without a zone are read as UTC. |
text, varchar, char | string | STRING | |
json, jsonb, uuid, xml, arrays, ranges, inet | string | STRING | Parse jsonb at query time, or flatten it before the sync with OLake Go's level-1 normalization. |
Postgres types in the table come from the Postgres connector reference; the Databricks side comes from DESCRIBE on the tables of this run.
Cost and maintenance
- Storage is the cloud bucket behind the catalog's managed location. You pay your cloud's storage rates for the Parquet data files and deletion vectors.
- Compute. OLake Go runs wherever you run Docker and does not use a Databricks warehouse or cluster to write. Databricks compute is spent only when you query; the checks on this page ran on a 2X-Small serverless SQL warehouse.
- Maintenance. Unity Catalog runs snapshot expiration and file compaction on managed Iceberg tables when predictive optimization is on (Databricks: Iceberg tables (checked Oct 2026)). Check that it is on for the catalog OLake Go writes to. Spark's
rewrite_data_filesalso works through the same Unity Catalog endpoint. - Token rotation. A personal access token expires on the date set when it was created, and an expired token fails the next sync at the first catalog call. Use a service principal with OAuth machine-to-machine credentials for production jobs.
- WAL disk. The replication slot keeps WAL until each sync reads it, so a job that runs every few minutes holds little. Pause the job for days and the slot holds days of WAL.
Troubleshooting
1. Postgres rejects the replication connection
FATAL: must be superuser or replication role to start walsender
The OLake Go user lacks the REPLICATION attribute. Run ALTER ROLE olake WITH REPLICATION;. On Amazon Relational Database Service (RDS) and Aurora grant the rds_replication role instead, because REPLICATION is reserved there.
2. Changes stop arriving after a long pause
The slot was invalidated because it passed max_slot_wal_keep_size, so the saved WAL position no longer exists. Check wal_status in pg_replication_slots; lost means the slot cannot resume. Drop and recreate the slot, then run the job again from a full refresh.
3. The destination test fails with a permission error
Three settings cover nearly every failure: External data access is off on the metastore, the principal lacks EXTERNAL USE SCHEMA on the catalog, or the catalog name in the destination is wrong. ALL PRIVILEGES does not include EXTERNAL USE SCHEMA, so a catalog owner still has to grant it explicitly. Run the grants from step 2 again for the principal that owns the token.
4. Databricks rejects a commit with "Can not create a Path from a null string"
Can not create a Path from a null string [ErrorCode: 2015]
Unity Catalog returns this when a client commits equality delete files to a managed Iceberg table (Databricks: access tables from Iceberg clients (checked Oct 2026)). Set Databricks as a target query engine on the job, so OLake Go writes deletion vectors. Start any table that was written with another delete format again from a full refresh.
How this compares with other ways to move Postgres data to Databricks
| Method | Freshness | Updates and deletes | Where the data lands | What you run |
|---|---|---|---|---|
| Lakeflow Connect PostgreSQL connector (checked Oct 2026) | CDC, run by Databricks | Yes, through CDC | Streaming tables governed by Unity Catalog | Nothing to host; runs on Databricks serverless compute |
| Debezium, Kafka and Structured Streaming from Kafka (checked Oct 2026) | Seconds | Yes, with your own merge logic | Kafka topics, then tables written by a Databricks streaming job | Kafka, Kafka Connect, Debezium and a running Databricks job |
COPY to a bucket, then COPY INTO or Auto Loader (checked Oct 2026) | Hours to daily | No; full reloads or your own merge | Tables written by a Databricks job | An export script, a bucket and a Databricks job |
| OLake Go to Iceberg on Unity Catalog (this guide) | CDC on a schedule down to one minute | Yes, as deletion vectors | Apache Iceberg tables that Databricks, DuckDB and Spark all read | One Docker Compose stack, open source; your storage plus your own compute |
Lakeflow Connect is the simpler choice when Databricks is the only reader and you want Databricks to run the pipeline. Writing Iceberg once avoids a second copy as soon as another engine needs the same rows.
When not to use this
- Tables have no primary key and cannot get
REPLICA IDENTITY FULL. Inserts replicate; updates and deletes do not. - Every query must run on Databricks-native tables. OLake Go writes managed Iceberg tables. If a pipeline needs native Delta Lake features on these rows, load them into a Delta table downstream.
FAQs
How do I replicate Postgres to Databricks without Lakeflow Connect?
Run OLake Go (open source, Apache 2.0) against Postgres with logical replication turned on, and point it at Unity Catalog's Iceberg REST endpoint. The first sync takes a full historical snapshot, every later sync replays only the changes from the write-ahead log, and the tables appear in Databricks as Unity Catalog managed Iceberg tables. No Kafka, Spark job or Databricks ingestion pipeline sits in the path.
Does OLake Go load the historical data before CDC starts?
Yes, automatically. A job in Full Refresh + CDC mode records a write-ahead log position, then copies every selected table in parallel chunks. Once the snapshot is committed it switches to CDC from that position, so no change made during the copy is lost and there is no separate backfill job.
Which Iceberg delete format does OLake Go write for Databricks?
Deletion vectors, on Iceberg v3 tables. Under Unity Catalog, Databricks reads deletion vectors and rejects commits that carry equality deletes. Setting Databricks as a target query engine on the job makes OLake Go pick deletion vectors from the first sync, so there is no format to choose.
Does this work with Amazon Relational Database Service (RDS), Aurora, Cloud SQL or Azure Postgres?
Yes, as long as logical replication is enabled. Managed services set wal_level through a parameter group or server setting rather than ALTER SYSTEM, and each has its own guide on this site. On RDS and Aurora the OLake Go user gets the rds_replication role instead of the REPLICATION attribute.
Which Postgres data types change on the way to Databricks?
numeric and decimal columns become Iceberg double and show up in Databricks as DOUBLE, so round at query time when you need exact decimal arithmetic. date and both timestamp types become TIMESTAMP in UTC. json, jsonb, uuid and array types arrive as STRING.
Can DuckDB and Spark read the same Databricks tables?
Yes. Both attach Unity Catalog as an Iceberg REST catalog with a token and receive vended storage credentials. In the run on this page DuckDB 1.5.5 and Spark 4.0.1 with Iceberg 1.10.0 returned the same 10 customers and the same orders roll-up as Databricks.
Related guides
Deeper reading on this site: