简体   繁体   中英

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.

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 . 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;");

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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