When I try to connect to Postgres 12.0 I get the following error
Unable to open database. Connection string: 'Server=127.0.0.1;User ID=postgres;Database=MyDatabase;'; Error: 'Npgsql.NpgsqlException (0x80004005): No password has been provided but the backend requires one (in MD5)
the connectionstring in App.config is the following
<add name="ConnectionString" connectionString="XpoProvider=Postgres;Server=127.0.0.1;User ID=postgres;Password=XXX663;Database=MyDatabase;Encoding=UNICODE" />
was able to create the database MyDataBase using DBUPDATER tool using the same connectionstring.
Found the following on the internet:
This is because of the Persist Security Info feature, which has been implemented in 3.1. Once a connection is open, getting its connection string will return it without a password. This is a security feature that allows you to pass around (open) NpgsqlConnection instances without having to worry about someone extracting the password from it.
The easiest way to work around this is simply to set Persist Security Info to true, which will make things work like in 3.0. Otherwise you need some external way to get the password, i.e. not from the connection.
I added Persist Security Info=true in connectionstring but it does not help
any idea??
thanks