r/SQL • • Mar 29 '26

PostgreSQL Daily SQL Server to PostGRE Synchronization

Looking for recommendations for performing once-daily replication (or synchronization) between an SQL Server (source) and Postgres (sink). The intent is to simply ensure that when a user performs a query or refresh for Postgres data, which is feeding a dashboard, the data is an accurate representation of the data in the SQL Server. This is all taking place on Windows Server 2022.

I found this reddit thread below on performing a similar activity using Debezium, but it is unclear to me if Kakfa is actually required (I'm currently not using Kafka). So my general question is, would Debezium still be the appropriate tool for completing this? Or is the once-daily requirement pointing towards a simpler solution such as a Python script that is run using Task scheduler?

https://www.reddit.com/r/PostgreSQL/comments/1hvff8t/mssql_to_postgre_replication/

https://github.com/debezium/debezium

1 Upvotes

22 comments sorted by

View all comments

Show parent comment

1

u/Sharp-Echo1797 Mar 29 '26

This is really a good use case for the foreign data wrapper process. For now just truncate and load every day. 700k rows is basically nothing.

If it slows down too much just rewrite some of the query and load processes to perform incremental loads.

1

u/minirova Mar 29 '26

Agreed. A FDW from Postgres to SQL Server could make this really simple. Then they could just schedule it with pg_cron and do the whole thing natively in Postgres.

1

u/murphinate Apr 11 '26

I did try the FDW for probably a day and a half, but I'm running Windows Server 2022 and I could not get the binaries to work properly. After enough struggling, I ended up creating a Python script and task scheduled it. If you happen to know where I could get some Server 2022 binaries for it, I'd like to try it again.