PostgreSQL to Snowflake
Replicate your PostgreSQL tables into Snowflake and keep them current, with incremental syncs on a schedule or CDC that reads the write-ahead log and carries deletes. Weld connects directly or through an SSH tunnel, and you choose per table how it syncs.
Checked against Weld and vendor docs on
Your own tables, picked when you set up the sync.
- Extract
- Load
- Keep in sync
- postgresql.Synced
- postgresql.Syncing
- postgresql.Synced
- postgresql.Synced
Trusted by data and AI teams
Three ways to get PostgreSQL data into Snowflake
Snowflake now has its own PostgreSQL connector, built on Openflow and generally available. It suits teams that want replication managed inside Snowflake. The deciding questions are how much you want to run yourself and whether Postgres is one source among many.
Openflow Connector for PostgreSQL
- Best for
- CDC replication managed inside Snowflake
- Effort
- Medium: an Openflow deployment and runtime, plus Postgres replication settings
- Freshness
- Near real time or on a schedule
- Good to know
- Generally available for PostgreSQL 11 to 18. Tables without a primary key or suitable replica identity replicate inserts only, TRUNCATE is ignored, and only username and password authentication is supported. Billed as Snowflake usage.
Export files and COPY INTO
- Best for
- One-off loads or a pipeline you script yourself
- Effort
- High: export, stage, load, and your own change tracking
- Freshness
- Whatever you schedule
- Good to know
- COPY INTO loads staged files such as CSV, JSON or Parquet on a warehouse you size, and Snowpipe can load files as they arrive. Updates and deletes are yours to reconcile.
Weld
- Best for
- Postgres alongside your other sources in one pipeline
- Effort
- Low: connect, pick tables, choose a sync mode per table
- Freshness
- CDC in near real time, or incremental and full syncs on your schedule
- Good to know
- Incremental syncs use the xmin system column, so tables need no updated_at column. CDC reads the WAL and propagates deletes. Full syncs into Snowflake are atomic.
How to sync PostgreSQL to Snowflake with Weld.
In the app, with the API or an agent.
What lands in Snowflake
From PostgreSQL to Snowflake.
Weld does not impose a schema on a database source: what lands in Snowflake is the tables you select, with the columns you keep.
- Your selected tables
One Snowflake table per PostgreSQL table you pick. Weld quotes every name it writes, so names stay lower case unless you turn on upper case for the sync.
- _weld_synced
A timestamp Weld adds to every row with the time it was last synced. Use it to check freshness without touching your own columns.
- Tables in your publication
For CDC, only tables in the publication you name can stream changes, and each needs a primary key or unique index and a replica identity other than NONE.
How fresh is each replicated table?
In Snowflake SQL.
Runs in Snowflake against a schema named postgres in the database Weld writes to. Names are double quoted because Weld creates them in lower case by default. Replace orders and customers with your own tables.
1select2 'orders' as table_name,3 count(*) as row_count,4 max("_weld_synced") as last_synced_at,5 datediff('minute', max("_weld_synced"), current_timestamp()) as minutes_since_sync6from "postgres"."orders"7union all8select9 'customers',10 count(*),11 max("_weld_synced"),12 datediff('minute', max("_weld_synced"), current_timestamp())13from "postgres"."customers"14order by minutes_since_sync descAsk your agent.
It queries Snowflake for you.
Connect Claude, Cursor, ChatGPT or your own agent to Weld over MCP. It reads the PostgreSQL context, finds the tables it needs and runs the query in Snowflake.
Which PostgreSQL tables do we have in Snowflake, and which is the largest?
Looking up what Weld has synced from PostgreSQL.
Things to know.
Before you sync PostgreSQL.
- Lower case names need quotes in Snowflake
- Snowflake resolves unquoted names to upper case, and Weld quotes every name it writes, so a table created as "orders" must be queried with quotes. Turn on upper case names when you create the sync if you want to query without quotes; the setting cannot be changed afterwards.
- Use key-pair authentication
- Snowflake is phasing out single-factor password sign-in, so Weld recommends key-pair authentication for its user. Encrypted private keys are the safer choice.
- Incremental syncs do not see deletes
- The xmin method finds new and changed rows but cannot tell which rows were deleted. Use a full sync at midnight for tables with frequent deletes, or CDC, which reads deletes from the WAL.
- CDC has database prerequisites
- CDC needs wal_level set to logical, a non-temporary logical replication slot, a publication, a primary key or unique index on every table, and a replica identity other than NONE. On PostgreSQL 13 or below, add a small heartbeat table so idle periods do not build up WAL.
- Unused slots hold on to WAL
- A replication slot left behind after you stop a sync makes PostgreSQL keep WAL indefinitely. Drop slots you no longer use and cap retention with max_slot_wal_keep_size.
Keep reading.
Guides, docs and schema.
Common questions.
About PostgreSQL to Snowflake.
Start syncing PostgreSQL to Snowflake.
Set up your PostgreSQL data pipeline in minutes. No credit card required. Free for 14 days.