I am using postgres 9.2 and when executing function dblink facing a fatal error while trying to execute dblink_connect as follows:

SELECT * FROM dblink_connect('host= port=5432 dbname=postgres password=test')

ERROR: could not establish connection DETAIL: FATAL: password authentication failed for user "NETWORK SERVICE"

What this error is related to? Do I need to modify pg_hba.conf file by any chance?

  • Perhaps you could tell us what operating system you're using, and what type of authentication you've configured?
    – voretaq7
    Feb 6, 2013 at 17:06

1 Answer 1


You need to specify the user parameter in the connect string, for example:

SELECT dblink_connect('host= port=5432 dbname=postgres user=postgres password=test')

otherwise it's taken from the user account's name and obviously it's not suitable in your case.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .