简体   繁体   English

Windows上具有命名管道的Postgres ODBC连接

[英]Postgres ODBC connection with named pipes on Windows

I'm developing an application in c# .NET that is connected to a PostgreSQL database through TCP/IP with ODBC. 我正在用C#.NET开发一个应用程序,该应用程序通过带ODBC的TCP / IP连接到PostgreSQL数据库。

It is possibile to connect through named pipes ? 是否可以通过命名管道进行连接? How can i do ? 我能怎么做 ?

Do i need to modify connection string ? 我需要修改连接字符串吗?

  1. PostgreSQL includes a .NET data provider- Npgsql . PostgreSQL包括一个.NET数据提供者Npgsql Any specific reason why are you using ODBC? 您为何使用ODBC的任何特定原因?
  2. PostgreSQL does not support named pipes- that is Windows-specific. PostgreSQL不支持Windows特定的命名管道。 You must use TCP. 您必须使用TCP。

For local PostgreSQL connections you can use the following connection string with Npgsql: 对于本地PostgreSQL连接,可以在Npgsql中使用以下连接字符串:

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

PostgreSQL不使用或不支持客户端连接的命名管道。

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

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