pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feeddblink authentication issue
3+ messages / 2 participants
[nested] [flat]
* dblink authentication issue
@ 2023-04-21 12:24 Daulat <daulat.dba@gmail.com>
0 siblings, 1 reply; 3+ messages in thread
From: Daulat @ 2023-04-21 12:24 UTC (permalink / raw)
To: pgsql-admin <pgsql-admin@lists.postgresql.org>
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,
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: dblink authentication issue
@ 2023-04-21 14:21 Tom Lane <tgl@sss.pgh.pa.us>
parent: Daulat <daulat.dba@gmail.com>
0 siblings, 1 reply; 3+ messages in thread
From: Tom Lane @ 2023-04-21 14:21 UTC (permalink / raw)
To: Daulat <daulat.dba@gmail.com>; +Cc: pgsql-admin <pgsql-admin@lists.postgresql.org>
Daulat <daulat.dba@gmail.com> writes:
> 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
This is intentional: to use a .pgpass file belonging to the server owner,
you must be a database superuser.
regards, tom lane
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: dblink authentication issue
@ 2023-04-22 06:53 Daulat <daulat.dba@gmail.com>
parent: Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 0 replies; 3+ messages in thread
From: Daulat @ 2023-04-22 06:53 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-admin <pgsql-admin@lists.postgresql.org>
Yes, I am using superuser "postgres".
It is the owner of the .pgpass file.
Thanks,
On Fri, Apr 21, 2023 at 7:51 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Daulat <daulat.dba@gmail.com> writes:
> > 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
>
> This is intentional: to use a .pgpass file belonging to the server owner,
> you must be a database superuser.
>
> regards, tom lane
>
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2023-04-22 06:53 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2023-04-21 12:24 dblink authentication issue Daulat <daulat.dba@gmail.com>
2023-04-21 14:21 ` Tom Lane <tgl@sss.pgh.pa.us>
2023-04-22 06:53 ` Daulat <daulat.dba@gmail.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox