Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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=127.0.0.1 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?

share|improve this question
    
Perhaps you could tell us what operating system you're using, and what type of authentication you've configured? –  voretaq7 Feb 6 '13 at 17:06
add comment

1 Answer

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

SELECT dblink_connect('host=127.0.0.1 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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.