SQL Server 2012: Add a linked server to PostgreSQL

Ok, I found the solution.

In the pg_hba.conf file, I change the method for sending passwords from MD5 to trust. After reloading the server, my linked server connection works.

the entry is now:

Type Database User Address   Method

host all      all  x.x.x.x/x trust

In hope that help others peoples.


I think I found the answer; I was still getting the error with a recent version of the ODBC driver and Postgres 10.x.

The connection will work when tested in the Windows ODBC diaglog, but will fail in SQL Server. When setting the password for the remote user, place the password in curly braces.

{password}

This will keep the ODBC connection string from getting screwed up if you have certain symbols in your user's password.