Windows 上的 Postgres ODBC 与命名管道连接

发布于 2024-09-15 15:35:50 字数 119 浏览 1 评论 0原文

我正在使用 c# .NET 开发一个应用程序,该应用程序通过 TCP/IP 和 ODBC 连接到 PostgreSQL 数据库。

可以通过命名管道连接吗?我该怎么办?

我需要修改连接字符串吗?

I'm developing an application in c# .NET that is connected to a PostgreSQL database through TCP/IP with ODBC.

It is possibile to connect through named pipes ? How can i do ?

Do i need to modify connection string ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

初心 2024-09-22 15:35:50
  1. PostgreSQL 包含一个 .NET 数据提供程序 - Npgsql 。您使用 ODBC 的具体原因是什么?
  2. PostgreSQL 不支持命名管道——这是 Windows 特有的。您必须使用 TCP。

对于本地 PostgreSQL 连接,您可以将以下连接字符串与 Npgsql 结合使用:


NpgsqlConnection conn = new NpgsqlConnection("数据库=数据库名称;用户ID=postgres;密码=mypassword;");

  1. PostgreSQL includes a .NET data provider- Npgsql . Any specific reason why are you using ODBC?
  2. PostgreSQL does not support named pipes- that is Windows-specific. You must use TCP.

For local PostgreSQL connections you can use the following connection string with Npgsql:


NpgsqlConnection conn = new NpgsqlConnection("Database=DatabaseName;User Id=postgres;Password=mypassword;");

伤痕我心 2024-09-22 15:35:50

PostgreSQL 不使用也不支持命名管道进行客户端连接。

PostgreSQL does not use or support named pipes for client connections.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文