dblink authentication issue

From: Daulat <daulat(dot)dba(at)gmail(dot)com>
To: pgsql-admin <pgsql-admin(at)lists(dot)postgresql(dot)org>
Subject: dblink authentication issue
Date: 2023-04-21 12:24:11
Message-ID: CALfOM6+5-S_u_DC4uq74c1n-nfhK-6p_fmEhHTdHH+p6W2aH7g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Hello,

I have some problem with using dblink_connect_u() while making a connection
using a .pgpass file.

select * from gis.dblink_connect_u('conn'||'X123','dbname='||'pgdb');
ERROR: could not establish connection
DETAIL: fe_sendauth: no password supplied

The .pgpass file is under postgres user home (home/postgres/.pgpass) and
has 0600 permission and postgres group.

I am able to connect with the ./pgpass file without using a user password.

:/opt/PostgreSQL-14/bin$ ./psql -d postgres -U postgres
psql (14.6)
Type "help" for help.

postgres=#

pg_hba.conf have the following entry:

host all all 127.0.0.1/32 md5

.pgpass have :

*:5432:*:postgres:2WSX#E86qrfv

I tried with the below (localhost and 127.0.0.1 and IP) also but no
success.
localhost:5432:*:postgres:2WSX#E86qrfv

127..0.0.1:5432:*:postgres:2WSX#E86qrfv

110.24.30.100:5432:*:postgres:2WSX#E86qrfv

When I provide the password in the connection string, there is no problem,
but when I don’t, it says:

select * from gis.dblink_connect_u('conn'||'X123','dbname='||'gisdb');
ERROR: could not establish connection
DETAIL: fe_sendauth: no password supplied

My Postgres server is running on Ubuntu, version 18.04.1 with PostgreSQL
14.6

Thanks,

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Tom Lane 2023-04-21 14:21:27 Re: dblink authentication issue
Previous Message Benjamin Acquaye 2023-04-20 15:42:58 Re: Unable to upgrade from 12.7 to 15.2