是否可以使用 FreeTDS 驱动程序和 tsql 连接到 PostgreSQL 服务器?

Is it possible to connect to a PostgreSQL server using FreeTDS driver and tsql?

我在 serverfault 上问过这个问题,有人让我在这里问。

我可以使用 FreeTDS 连接到 PostgreSQL 服务器,更具体地说是使用 tsql 命令吗?

我已经尝试了几天,使用了许多不同的配置。即使我能够使用 isql 和 PostgreSQL odbc 驱动程序连接到数据库,我也无法使用 tsql 使其工作(它似乎也没有使用 odbc.iniodbcinst.ini)。所以,我想知道 tsql 命令是否只适用于 SQL 服务器。

如果需要,我可以 post 文件 freetds.conf、odbc.ini 和 odbcinst.ini。

谢谢。

FreeTDS 仅支持 TDS 协议(因此得名)。而这个协议只有Microsoft SQL Server和Sybase数据库实现。

所以,您不能不能使用 FreeTDS 连接到 Postgres 数据库。

您需要使用Postgres ODBC driver, the Postgres .Net driver or the Postgres JDBC driver to do this - depending on the programming language of your application. From a C program you can also connect to Postgres directly using the libpq library