[英]Connect SQL Server database to PostgreSQL
I want to connect a SQL Server database by using pgAdmin4
.我想使用
pgAdmin4
连接 SQL 服务器数据库。 I already have data in the SQL Server database and want to connect this database in PostgreSQL.我已经在 SQL 服务器数据库中有数据,并且想在 PostgreSQL 中连接这个数据库。 I have tried with foreign data also but not working.
我也尝试过使用外国数据,但没有工作。
If anyone knows the solution it would be really appreciated.如果有人知道解决方案,将不胜感激。
There are two solutions that I've used:我使用过两种解决方案:
tds_fdw
tds_fdw
You can install tds_fdw
that is a foreign data wrapper to MSSQL to postgreSQL and, with this foreign data wrapper, you can use your MSSQL tables and schemas as foreign tables inside postgresql.您可以将
tds_fdw
作为 MSSQL 的外部数据包装器安装到 postgreSQL,并且使用此外部数据包装器,您可以将 MSSQL 表和模式用作 postgresql 中的外部表。 More details here .更多细节在这里。
As you not provisioned which OS you are using, is better to se inside the project and apply as your needs.由于您没有配置您正在使用的操作系统,因此最好在项目中设置并根据您的需要应用。
A little bit complicated than installing a fdw
, you can do a streaming replication enabling CDC on MSSQL Server and collecting via Debezium the tables that you need and real-time replicating to you PostgreSQL database connecting via JDBC so, you need what is your scenario and decide what is the best option.比安装
fdw
有点复杂,您可以在 MSSQL Server 上启用 CDC 并通过 Debezium 收集您需要的表并实时复制到您 PostgreSQL 数据库通过 JDBC 连接的数据库,所以,您需要什么是您的场景和决定什么是最好的选择。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.