Re: dblink authentication failed

From: Scott Mead <scottm(at)openscg(dot)com>
To: Kiss Attila <kiss(dot)attila(at)dardanis(dot)hu>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: dblink authentication failed
Date: 2016-06-27 09:18:59
Message-ID: 7E3ACF9A-DD05-4D99-823B-F8D075A4F000@openscg.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> On Jun 27, 2016, at 03:38, Kiss Attila <kiss(dot)attila(at)dardanis(dot)hu> wrote:
>
> Hello,
> I have some problem with using dblink_connect_u() in my function.
> When I provide the password in the connection string, there is no problem, but when I don’t, it says:
> ERROR: could not establish connection
> DETAIL: fe_sendauth: no password supplied
> However the .pgpass file in the path /var/lib/postgres/.pgpass does contain the proper password.
> I have tried to connect to the remote server with psql from bash with the following command:
> # psql –h 192.168.1.40 –U myuser –w remote_db_name
> it works fine.
> My .pgpass file does have the line:
> 192.168.1.40:5432:*:myuser:mypassword
> It seems the psql finds the proper password in the .pgpass file but dblink doesn’t.

When dblink makes the connection, the client is actually the dbserver itself. This means that your .pgpass file needs to be setup in the database server as the user running the postgres process.

> The local and the remote server are running on Ubuntu server 14.04, both of them are PostgreSQL 9.4.
> The .pgpass file properties look this:
> # ls –la ./.pgpass
> -rw------- 1 postgres postgres 193 jún 24 13:54 ./.pgpass
>
> Any ideas are welcome.
> Regards,
> Attila
>
> Mentes a vírusoktól. www.avast.com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Francisco Olarte 2016-06-27 09:19:08 Re: dblink authentication failed
Previous Message Kiss Attila 2016-06-27 07:38:34 dblink authentication failed