Skip to main content

Postgres to Snowflake: CDC via Apache Iceberg

Postgres to Snowflake comes down to one choice. Copy the rows into tables Snowflake owns, or write them once as Apache Iceberg tables that Snowflake and every other engine can read. This guide does the second.

OLake Go captures Postgres changes with logical replication and commits them as Iceberg tables into a catalog Snowflake reads. With Snowflake's own Horizon catalog, the default on this page, the files sit on Snowflake-managed storage and nothing else is in the path: no Kafka, no Spark. With AWS Glue, the files sit in your S3 bucket and Snowflake reads them through a catalog integration.

Key takeaways

  • OLake Go replicates Postgres into Snowflake 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.
  • Through the Horizon catalog the tables land as Snowflake-managed Iceberg tables. You query them in Snowsight right away, with no CREATE ICEBERG TABLE, no external volume and no refresh.
  • The same tables, written once by OLake Go, are also queryable from DuckDB and Spark through the same catalog. In the run on this page all three engines returned identical rows.

The short answer. To replicate Postgres to Snowflake with change data capture (CDC), run OLake Go with Postgres logical replication as the source and the Snowflake Horizon catalog as the Iceberg destination. The first sync copies each table in full (the historical snapshot); every later sync replays inserts, updates and deletes from the write-ahead log. Snowflake, DuckDB and Spark then query the same Iceberg tables, with no second copy.

How Postgres CDC reaches Snowflake 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.

Each sync ends with one commit to Horizon. OLake Go asks Horizon for short-lived storage credentials, uploads the data and delete files, then posts the new snapshot to the catalog. Snowflake sees it the moment the commit lands; 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 Snowflake account where you can run the one-time setup as ACCOUNTADMIN. Snowflake-managed storage means no cloud bucket or IAM role on your side.
  • OLake UI from the Docker Compose install, with the OLake Go Postgres source on v0.11 or later. The run on this page used 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
Sample schema
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.

SettingValueWhy it matters
wal_levellogicalWithout it Postgres writes no row images to the WAL (write-ahead log), so there is nothing to replicate. Changing it needs a restart.
Replication roleLOGIN REPLICATION plus SELECT on the tablesThe first snapshot reads the tables; the change stream opens a replication connection.
Publicationone per OLake Go job, covering the synced tablesTells Postgres which tables' changes to publish.
Replication slotone per OLake Go job, plugin pgoutputKeeps WAL segments until OLake Go has read them.
On the source database
-- 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:

sql
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 runsGuide
Amazon RDSRDS Postgres CDC setup
Amazon AuroraAurora Postgres CDC setup
Azure Database for PostgreSQLAzure Postgres CDC setup
Google Cloud SQLCloud SQL Postgres CDC setup
Your own server or VMGeneric Postgres CDC setup
Docker, for a local testLocal Postgres with Docker Compose
One slot and one publication per job

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 the catalog in Snowflake​

Snowflake reads Iceberg tables from two kinds of catalog. Horizon is Snowflake's own: OLake Go writes straight into it, the tables are Snowflake-managed, and they appear in Snowsight the moment a sync commits. AWS Glue is a catalog outside Snowflake, so the files stay in your S3 bucket.

Snowflake reaches them through a catalog integration: a read-only link to that external catalog, refreshed after each sync.

Horizon is the default on this page. Glue is the right pick when Athena, Redshift or Spark on Amazon Elastic MapReduce (EMR) will read the same tables and you want the files in your own bucket.

CatalogOLake Go writesSnowflake readsVerified on this page
AWS GlueYesYes: catalog integration (read-only)Documented, not yet run by us
Snowflake HorizonYesYes: native: tables are Snowflake-managed Iceberg tablesYes, end to end

Snowflake Horizon is the catalog built into every Snowflake account. OLake Go talks to it through the Iceberg REST endpoint at https://<account_identifier>.snowflakecomputing.com/polaris/api/catalog, and the tables it creates are Snowflake-managed Iceberg tables. Writing through this endpoint needs OLake Go 0.11.0 or later.

Run the following once in a Snowsight worksheet as ACCOUNTADMIN. It creates a database for the tables, a role OLake Go writes as, a service user that holds the token, and the authentication policy the token needs.

Snowflake, once per account
USE ROLE ACCOUNTADMIN;

-- A small warehouse for your own queries, and the database OLake Go writes into.
CREATE WAREHOUSE IF NOT EXISTS OLAKE_WH WAREHOUSE_SIZE = XSMALL AUTO_SUSPEND = 60 AUTO_RESUME = TRUE;
CREATE DATABASE IF NOT EXISTS OLAKE_DEMO;
ALTER DATABASE OLAKE_DEMO SET CATALOG = 'SNOWFLAKE';
ALTER DATABASE OLAKE_DEMO SET EXTERNAL_VOLUME = 'SNOWFLAKE_MANAGED';

-- The role OLake Go uses. It needs to create schemas; tables are created inside them.
CREATE ROLE IF NOT EXISTS OLAKE_ROLE;
GRANT USAGE, CREATE SCHEMA ON DATABASE OLAKE_DEMO TO ROLE OLAKE_ROLE;
GRANT USAGE ON WAREHOUSE OLAKE_WH TO ROLE OLAKE_ROLE;
GRANT ROLE OLAKE_ROLE TO ROLE SYSADMIN;

-- A service user for OLake Go. It holds the programmatic access token.
CREATE USER IF NOT EXISTS OLAKE_SVC TYPE = SERVICE DEFAULT_ROLE = OLAKE_ROLE;
GRANT ROLE OLAKE_ROLE TO USER OLAKE_SVC;

-- Snowflake issues a token to a service user only under a network policy, unless an
-- authentication policy waives that. This one waives it. Any schema can hold the policy.
USE SCHEMA OLAKE_DEMO.PUBLIC;
CREATE AUTHENTICATION POLICY IF NOT EXISTS olake_pat_policy
PAT_POLICY = (NETWORK_POLICY_EVALUATION = ENFORCED_NOT_REQUIRED);
ALTER USER OLAKE_SVC SET AUTHENTICATION POLICY olake_pat_policy;

-- The two values OLake Go asks for.
SELECT CURRENT_ORGANIZATION_NAME() || '-' || CURRENT_ACCOUNT_NAME() AS account_identifier,
CURRENT_REGION() AS region;

-- The token. Snowflake shows the secret once; copy it straight into OLake Go.
ALTER USER OLAKE_SVC ADD PROGRAMMATIC ACCESS TOKEN OLAKE_PAT
ROLE_RESTRICTION = 'OLAKE_ROLE' DAYS_TO_EXPIRY = 30;

What each block is for:

  • CATALOG = 'SNOWFLAKE' and EXTERNAL_VOLUME = 'SNOWFLAKE_MANAGED' on the database make every table OLake Go creates a Snowflake-managed Iceberg table on Snowflake's own storage. No S3 bucket, IAM role or external volume on your side. To keep the files in your own bucket, create an external volume and name it here instead.
  • The authentication policy is the step people miss. Without it, the ADD PROGRAMMATIC ACCESS TOKEN line fails with Network Policy is required when creating a programmatic access token for user OLAKE_SVC. In production, attach a network policy that allows OLake Go's egress IP instead of waiving the check.
  • ROLE_RESTRICTION pins the token to OLAKE_ROLE, so a leaked token cannot act as ACCOUNTADMIN. Tokens expire after DAYS_TO_EXPIRY (15 by default, 365 at most). Rotate it before then or the sync fails with an authentication error.

You can check the token outside OLake Go by exchanging it for a session token, the same call OLake Go makes on every sync:

Token check
curl -s -X POST "https://<account_identifier>.snowflakecomputing.com/polaris/api/catalog/v1/oauth/tokens" \
-H 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode grant_type=client_credentials \
--data-urlencode scope=session:role:OLAKE_ROLE \
--data-urlencode client_secret=<your PAT>

A good token returns a JSON object with an access_token. The other authentication methods (key-pair JWT, External OAuth, workload identity federation) are on the Horizon catalog page.

Step 3: Connect Postgres to OLake Go​

  1. 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.
  2. 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.
  3. 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.
  4. 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.

OLake UI Create source form for Postgres on OLake Go v1.1.0 with Enable CDC on, replication slot olake_slot, publication olake_pub and the connection details
The Postgres source in OLake UI: Enable CDC on, with the slot and publication from step 1.

Set up source runs the connection test and the four CDC checks before anything is saved:

OLake UI Testing Source Configuration dialog showing Test Connection successful, 4 of 4 required CDC prerequisite checks passed and 1 of 1 optional CDC setting passed
The source test: connection, the four required CDC prerequisites and the optional setting all pass.

The full field reference, including SSL modes and SSH tunnels, is on the Postgres connector page.

Step 4: Configure the Iceberg destination​

  1. Open Destinations and click Create Destination.
  2. Pick Apache Iceberg as the connector and Horizon as the catalog type.
  3. Choose Programmatic Access Token (PAT) as the authentication type and fill in the fields below.
  4. Click Create. OLake Go calls the Horizon endpoint, exchanges the token and saves the destination.
OLake UI destination form for the Snowflake Horizon catalog with the PAT authentication fields

Horizon Configuration Parameters

ParameterSample ValueDescription
Authentication Type
required
Programmatic Access Token (PAT)Authentication method OLake Go uses for Horizon Catalog REST API requests. Set to match your workspace's authentication configuration.
Horizon Iceberg REST Catalog URI
required
https://<account_identifier>.snowflakecomputing.com/polaris/api/catalogSnowflake Horizon Catalog REST API endpoint.
Snowflake Database
required
SNOWThe name of the database in Snowflake.
Session Role Scope
required
session:role:<HORIZON_ROLE>Informs Snowflake which role to use for this Horizon Catalog REST session, which controls privileges for catalog and table operations. Space-separated if providing more than one.
Programmatic Access Token
required
ver:1-hint:...Snowflake programmatic access token (PAT).
Cloud Storage Region
required
AWS_AP_SOUTH_1Snowflake's account region used to route requests to the correct storage endpoint. Run SELECT CURRENT_REGION(); to know the region
Catalog NamehorizonName of the Iceberg catalog OLake Go registers tables under. Defaults to olake_iceberg if left empty.
Enable Arrow WritesfalseWrites data and delete files using Apache Arrow based writer and registers them in Iceberg.
Catalog Name Supported for v0.3.5 and above
For the catalog name, OLake Go only supports lowercase letters and underscores. Spaces and special characters are not supported.

Step 5: Create the job and run the first sync​

  1. 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.
  2. Select the source and the destination you created.
  3. Under Advanced Settings, set Target Query Engines to Snowflake, 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.
  4. Click Next. OLake Go discovers the tables and opens the Streams page.
  5. 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 (Positional Deletes in the run on this page).
  6. 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. That is the only format decision you make: OLake Go works out which Iceberg delete format all three can read and sets it on every stream.

OLake UI Create Job page with Postgres source, Apache Iceberg destination and target query engines Apache Spark, DuckDB and Snowflake
Target query engines on the job: OLake Go resolves a delete format Spark, DuckDB and Snowflake can all read.
OLake UI Streams Selection page with customers and orders selected, sync mode Full Refresh + CDC, ingestion mode Upsert and upsert type Positional Deletes on Iceberg format version V2
Each stream: Full Refresh + CDC, Upsert, and the upsert type OLake Go resolved for the three engines (Positional Deletes in this run). The Iceberg DB name at the top is editable.
OLake UI Job Logs and History for pg_to_snowflake showing two completed syncs, the first in 41 seconds and the second in 23 seconds
Job history: the 41 s historical snapshot, then the 23 s change-only sync.

On this page the first run copied 8 customers and 40 orders and finished in 41 seconds, container start included. OLake Go names the destination schema after the job, the source database and the source schema, so pg_to_snowflake on database shop produced pg_to_snowflake_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 Snowflake​

There is no registration step. The schema and tables OLake Go committed through Horizon are already Snowflake-managed Iceberg tables in the database you configured. One thing to know before the first query: OLake Go creates them with quoted, lowercase names, so Snowflake needs the double quotes.

Snowsight
-- What OLake Go created (schema = <job name>_<source database>[_<source schema>])
SHOW ICEBERG TABLES IN SCHEMA OLAKE_DEMO."pg_to_snowflake_shop_public";

-- Quoted identifiers: the names are lowercase, as they were in the source
SELECT "id", "name", "city", "tier"
FROM OLAKE_DEMO."pg_to_snowflake_shop_public"."customers"
ORDER BY "id";

SHOW ICEBERG TABLES reports catalog_name = SNOWFLAKE, iceberg_table_type = MANAGED and external_volume_name = SNOWFLAKE_MANAGED: Snowflake treats them as its own managed Iceberg tables, not as external tables that need a refresh.

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.

Snowsight SQL file running SHOW ICEBERG TABLES on the pg_to_snowflake_shop_public schema and listing customers and orders with owner OLAKE_ROLE, external volume SNOWFLAKE_MANAGED, catalog SNOWFLAKE and table type MANAGED
SHOW ICEBERG TABLES in Snowsight: both tables are Snowflake-managed, created by OLAKE_ROLE through Horizon.
Snowsight query on OLAKE_DEMO.pg_to_snowflake_shop_public.customers returning 10 rows with id, name, city and tier in 739 ms
The customers table in Snowsight after the change sync: 10 rows in 739 ms on an X-Small warehouse.

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:

Changes made in Postgres between the two syncs
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 (2, 5, 8);

The second sync read 12 records (589 bytes) from the slot and finished in 23 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 small delete file retires the 2 old versions. OLake Go's commit report in the sync log shows it directly: addedDataFiles=1, addedRecords=4, addedPositionalDeleteFiles=1, addedPositionalDeletes=2, and the table commit itself took 0.64 seconds.

OLake UI sync log filtered to the Iceberg commit reports for orders and customers, showing addedDataFiles 1, addedPositionalDeleteFiles 1, addedRecords 8 and 4, totalEqualityDeletes 0
The change-only sync in the OLake UI log: one data file and one positional delete file per table, zero equality deletes.

Snowflake shows the result with no refresh. Liam Carter is gold, Zara Ali moved to Abu Dhabi, and the two new customers are there. The updated_at column shows which rows the second sync touched:

Snowsight query on customers after the CDC sync showing 10 rows with _op_type r for the snapshot rows, u for Liam Carter and Zara Ali, c for Maya Patel and Lucas Silva, and updated_at for the changed rows
Snowsight after the change sync: the two updates (u), the two inserts (c) and the untouched snapshot rows (r), 10 rows in 260 ms.

Schema changes. When a column is added in Postgres, OLake Go adds it to the Iceberg table on the next sync, and Snowflake shows it. 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​

This is the point of writing Iceberg instead of loading Snowflake tables. Nothing is exported, copied or refreshed: both engines read the files OLake Go wrote, through the same Horizon endpoint, with credentials vended by Snowflake.

DuckDB attaches Horizon as an Iceberg REST catalog. It wants a bearer token rather than the raw PAT, so exchange the PAT first (the curl call from the catalog setup), then attach:

DuckDB 1.5.5
INSTALL iceberg; LOAD iceberg;
INSTALL httpfs; LOAD httpfs;

CREATE SECRET horizon_secret (TYPE iceberg, TOKEN '<access_token from /v1/oauth/tokens>');

ATTACH 'OLAKE_DEMO' AS horizon (
TYPE iceberg,
ENDPOINT 'https://<account_identifier>.snowflakecomputing.com/polaris/api/catalog',
SECRET horizon_secret,
ACCESS_DELEGATION_MODE 'vended_credentials'
);

SHOW ALL TABLES;
SELECT id, name, city, tier FROM horizon.pg_to_snowflake_shop_public.customers ORDER BY id;

The session token lives about an hour; re-run the exchange and CREATE OR REPLACE SECRET when a query fails with an authorization error. DuckDB reads deletion vectors from duckdb-iceberg 1.5.3 onward, and only attaches REST catalogs backed by S3, S3 Tables or Google Cloud Storage, so pick an AWS- or GCP-hosted Snowflake account for this path.

DuckDB 1.5.5 shell querying horizon.pg_to_snowflake_shop_public.customers and returning the same 10 rows as Snowflake
DuckDB 1.5.5 reading the Snowflake-managed table through Horizon: the same 10 rows.

An orders roll-up matched Postgres to the cent in all three engines: 13 delivered orders for 4787.08, 18 placed for 9172.63, 14 shipped for 7305.62.

Data types: Postgres to Iceberg to Snowflake​

OLake Go maps Postgres types to Iceberg types, and Snowflake maps Iceberg types to its own. Most columns pass through unchanged; three groups are worth knowing about.

PostgresIceberg (written by OLake Go)Snowflake showsNotes
int, serial, smallintintNUMBER(10,0)
bigint, bigseriallongNUMBER(19,0)
numeric, decimal, real, float4doubleFLOATOLake Go stores decimals as doubles. The orders.amount sums on this page matched Postgres to the cent in every engine; round at query time when you need exact decimal arithmetic.
double precisiondoubleFLOAT
booleanbooleanBOOLEAN
date, timestamp, timestamptztimestamptz (UTC)TIMESTAMP_LTZ(6)date gains a midnight UTC time. Timestamps without a zone are read as UTC, so set the session zone before comparing.
text, varchar, charstringVARCHAR
json, jsonb, uuid, xml, arrays, ranges, inetstringVARCHARParse jsonb with PARSE_JSON() in Snowflake, 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 Snowflake side from Snowflake's Iceberg data types page (checked 2026-10-14).

Cost and maintenance​

  • Storage is Snowflake's with SNOWFLAKE_MANAGED: you pay Snowflake storage rates for the Parquet and delete files. Point the database at your own external volume to keep the files in your bucket instead.
  • Compute. OLake Go runs wherever you run Docker; it does not use a Snowflake warehouse to write. Snowflake compute is spent only when you query.
  • Maintenance. Snowflake expires old snapshots and compacts manifests on Snowflake-managed tables at no cost. Automatic data-file compaction is bundled only when Snowflake alone writes the table (Snowflake-managed Iceberg table maintenance). A CDC table that gets a new small file every minute will want compaction from the writer side; OLake Fusion does this for the catalogs OLake Go writes to, and Spark's rewrite_data_files works through the same Horizon endpoint.
  • Token rotation. The programmatic access token expires (30 days in the setup above, 365 at most). Put the renewal on a calendar; an expired token fails the next sync at the catalog handshake, before any data moves.

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. Snowflake cannot find the table​

SQL compilation error:
Object 'OLAKE_DEMO.PG_TO_SNOWFLAKE_SHOP_PUBLIC.CUSTOMERS' does not exist or not authorized.

Snowflake upper-cased an unquoted identifier. OLake Go creates the schema and tables with their lowercase Postgres names, so quote them: OLAKE_DEMO."pg_to_snowflake_shop_public"."customers". It cuts both ways: if you create the database as "olake_demo" in quotes, OLake Go must be configured with olake_demo, not OLAKE_DEMO.

3. The destination test fails at the catalog handshake​

OLake Go's destination test exchanges the token at /v1/oauth/tokens before anything else. Three causes account for nearly every failure, in order of likelihood:

  1. No network or authentication policy on the service user. Snowflake issues a programmatic access token to a service user only under a network policy, unless an authentication policy with NETWORK_POLICY_EVALUATION = ENFORCED_NOT_REQUIRED waives it. The SQL in step 2 creates that policy; without it, the ADD PROGRAMMATIC ACCESS TOKEN line itself fails. Snowflake's programmatic access token page has the full rule.
  2. Wrong scope or role. scope must be session:role:<role> and the role must match the token's ROLE_RESTRICTION.
  3. Expired token. Tokens default to 15 days. Re-issue with ALTER USER ... ADD PROGRAMMATIC ACCESS TOKEN and update the destination.

Run the curl exchange from the catalog setup; it returns the same error Snowflake gives OLake Go, without the UI in between.

4. Snowflake shows stale rows on a table from an older job​

A job created without a target query engine defaults to equality deletes, which Snowflake does not read. Edit the job's streams, set the target query engine to Snowflake, and OLake Go switches the upsert type to one Snowflake reads. On the next sync it rewrites the existing delete files into the new format.

How this compares with other ways to move Postgres to Snowflake
MethodFreshnessUpdates and deletesWhere the data landsWhat you run
Snowflake Openflow connector for PostgreSQLCDC through logical replicationYes, as soft deletes plus journal tablesNative Snowflake tables (an Iceberg target exists); Snowflake is the only readerAn Openflow deployment in Snowpark Container Services or your own AWS account, billed in Snowflake credits
Debezium, Kafka and the Snowflake Kafka connectorSecondsYes, with the connector's tombstone handlingKafka topics, then Snowflake tablesKafka, Kafka Connect, Debezium and a schema registry
Managed ELT (Fivetran, Estuary, Airbyte Cloud)Minutes, by planYesSnowflake tables, a second copy you pay to move and storeNothing; priced per row, per GB or per connector
Manual export (COPY to S3, COPY INTO)Hours to dailyNo; full reloads onlyFiles you controlA script and a scheduler
OLake Go to Iceberg on Horizon (this guide)CDC on a schedule down to one minuteYes, as Iceberg row-level deletesApache Iceberg tables that Snowflake, DuckDB, Spark and Trino all readOne Docker Compose stack, open source; Snowflake storage plus your own compute

Openflow is the simpler choice when Snowflake is the only reader and you want Snowflake to run the pipeline. Writing Iceberg once avoids paying to move and store a second copy as soon as another engine needs the same rows, or you want to own the files.

When not to use this​

  • Your Snowflake account is on Azure and DuckDB is a reader. DuckDB attaches REST catalogs backed by S3, S3 Tables and Google Cloud Storage only, so pick Spark or Trino as the second engine there.
  • Tables have no primary key and cannot get REPLICA IDENTITY FULL. Inserts replicate; updates and deletes do not.

FAQs​

How do I sync Postgres to Snowflake without paying for a managed connector?

Run OLake Go (open source, Apache 2.0) against your Postgres with logical replication turned on, and point it at Snowflake's Horizon catalog. The first sync takes a full historical snapshot of the tables, every later sync replays only the changes from the write-ahead log, and the tables appear in Snowflake as Snowflake-managed Iceberg tables. There is no Kafka, Spark or Snowflake connector in the path.

Does OLake Go load the historical data before CDC starts?

Yes, automatically. A job in Full Refresh + CDC mode first copies every selected table in parallel chunks (the historical snapshot), from a write-ahead log position it records before the copy starts. Once the snapshot is committed it switches to CDC from that position, so no change made during the snapshot is lost and there is no separate backfill job to run.

What is the best ETL tool for Postgres to Snowflake?

It depends on who reads the data and who should own the files. Snowflake Openflow is the right pick when everything stays inside Snowflake and you want a Snowflake-run service. Fivetran, Estuary and Airbyte fit teams that want many connectors under one bill. OLake Go fits when Snowflake is one reader among several and you want the data in Apache Iceberg tables that DuckDB, Spark or Trino can also query. In OLake's published ingestion benchmarks it also posted higher snapshot and CDC throughput than the other tools measured.

Can Snowflake read Iceberg tables written by other tools?

Yes. External engines can create and write Snowflake-managed Iceberg tables through the Horizon catalog's Iceberg REST API, and the tables are queryable in Snowflake with no registration step. Snowflake reads positional deletes on Iceberg v2 tables and deletion vectors on v3 tables, which are the formats OLake Go writes for it.

Is Postgres to Snowflake replication with OLake Go real time?

It is near real time on a schedule you pick. OLake Go reads the Postgres write-ahead log through logical replication, so nothing is lost between runs, and each run commits one Iceberg snapshot. In the run on this page a change-only sync of 12 rows completed in 23 seconds end to end, container start included. Schedules down to one minute are supported.

Which Postgres data types change on the way to Snowflake?

numeric and decimal columns become Iceberg double and show up in Snowflake as FLOAT, so round at query time if you need exact decimal arithmetic. date and both timestamp types become timestamptz in UTC (Snowflake TIMESTAMP_LTZ(6)). json, jsonb, uuid and array types arrive as VARCHAR. Everything else maps one to one.

Does this work with Amazon RDS, Aurora, Cloud SQL, Azure or Supabase 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. Supabase allows replication slots only on its direct connection, and read replicas on Postgres 15 and earlier cannot be used as the CDC source.

Can I use AWS Glue instead of the Horizon catalog?

Yes. With Glue as the catalog the files stay in your S3 bucket, Athena, Redshift and EMR read them natively, and Snowflake reads them through a catalog integration as read-only tables you refresh after each sync. Horizon is the better default when Snowflake is the main reader, because the tables are Snowflake-managed and need no refresh.

Deeper reading on this site: