Installed PostgreSQL Version 12.1 in Windows 10 (downloaded from this page)
But got two servers, as below:
(Why PostgreSQL 10 got installed?)
In a .NET C# project the below code auto connects to the database postgres under PostgreSQL 10:
string Server = "localhost";
string Port = "5432";
string Username = "postgres";
string Password = "123456";
string Database = "postgres";
string connString =
String.Format(
"Server={0};Port={1};Username={2};Password={3};Database={4};SSLMode=Prefer",
Server,
Port,
Username,
Password,
Database);
using (var sqlConnection = new NpgsqlConnection(connString))
{
sqlConnection.Open(); // here opens database postgres under PostgreSQL 10
}
How to change the code to open database postgres from PostgreSQL 12 instead of PostgreSQL 10?
