From: Erik Wienhold <ewie@ewie.name>
To: Daulat <daulat.dba@gmail.com>
To: pgsql-admin <pgsql-admin@lists.postgresql.org>
Subject: Re: DBLINK Error
Date: Sat, 2 Sep 2023 15:27:57 +0200 (CEST)
Message-ID: <1504262683.74455.1693661277706@office.mailbox.org> (raw)
In-Reply-To: <CALfOM6LjKQ4+YTo7eWivnfDny9iRCOvwTij4kQda6qJ=zWgLRw@mail.gmail.com>
References: <CALfOM6LjKQ4+YTo7eWivnfDny9iRCOvwTij4kQda6qJ=zWgLRw@mail.gmail.com>
On 02/09/2023 09:50 CEST Daulat <daulat.dba@gmail.com> wrote:
> I am facing an issue while fetching data using dblink.
> I am using a .pgpass file and MD5 for authentication.
What does ~postgres/.pgpass and pg_hba.conf look like?
> .pgpass file is located in the home directory (postgres user home) of the
> user running the PostgreSQL query. This file has proper permission 0600 and
> owner postgres to keep it secure. The OS is Amazon Linux.
>
> Connection made successfully without giving password.
>
> [root@DEM-MT bin]# ./psql -d postgres -U postgres
> psql (14.6)
> Type "help" for help.
>
> postgres=#
Does root also have a .pgpass file? Otherwise this looks like user postgres is
configured with trust authentication (at least on database postgres) if there's
no password prompt for user postgres.
> cd /opt/PostgreSQL-14/bin/
> [root@DEM-MT bin]# ./psql -d postgres -U postgres -W
> Password:
> psql (14.6)
> Type "help" for help.
>
> postgres=#
Does it accept any password? That would be the case for trust authentication.
> ERROR:
> -----------
>
> cd /opt/PostgreSQL-14/bin/
> [postgres@DMM-MT bin]$ ./psql -U postgres -d tn2_demo_10
>
> tn2_demo_10=# select * from ucf.dblink_connect_u('conn','dbname="ADT_DEM_DB"');
> ERROR: could not establish connection
> DETAIL: connection to server on socket "/tmp/.s.PGSQL.5432" failed: fe_sendauth: no password supplied
Okay, no trust authentication for user postgres on database ADT_DEM_DB. My
guess is an error in ~postgres/.pgpass so that libpq does not find a matching
entry for the connection.
--
Erik
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: ewie@ewie.name, daulat.dba@gmail.com, pgsql-admin@lists.postgresql.org
Subject: Re: DBLINK Error
In-Reply-To: <1504262683.74455.1693661277706@office.mailbox.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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