简体   繁体   English

将MSSQL创建的数据库与PostgreSQL连接

[英]Connect a MSSQL created database with PostgreSQL

I use Mac and PostgreSQL is the choice for db management. 我使用Mac,而PostgreSQL是数据库管理的选择。 I can not install MSSQL. 我无法安装MSSQL。 There's a db which is created and managed by MSSQL. 有一个由MSSQL创建和管理的数据库。 I must not copy the entire data via a script, to my database (because of using real time data) My only option is, connecting that MSSQL created db with PostgreSQL. 我绝对不能通过脚本将整个数据复制到我的数据库中(因为使用实时数据)。我唯一的选择是将MSSQL创建的数据库与PostgreSQL连接起来。

Is it possible? 可能吗? If yes, how? 如果是,怎么办? Will there be any relevant limitations for my queries? 我的查询会有任何相关限制吗? Thanks. 谢谢。

Additional details: 额外细节:

I'll make selections, calculations, statistically. 我将进行统计选择,计算。 I won't modify the existing data. 我不会修改现有数据。

The feature, which allows you to connect to a different database from within PostgreSQL itself, is called foreign data wrapper . 该功能允许您从PostgreSQL本身连接到其他数据库 ,该功能称为外部数据包装器

Here , there is a list of available foreign data wrappers, but mssql is not included. 在这里 ,列出了可用的外部数据包装器,但不包括mssql。 But ODBC is, so (in theory) if you install odbc_fdw , you can access foreign mssql tables in your PostgreSQL instance. 但是ODBC是,因此(理论上),如果您安装odbc_fdw ,则可以在PostgreSQL实例中访问外部mssql表。

There is also a tds_fdw for SQL Server which uses FreeTDS for the connection rather than ODBC 对于SQL Server ,还有一个tds_fdw,它使用FreeTDS进行连接而不是使用ODBC。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM