Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qcQfc-00FJwy-JB for pgsql-admin@arkaria.postgresql.org; Sat, 02 Sep 2023 13:28:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qcQfa-007isK-3T for pgsql-admin@arkaria.postgresql.org; Sat, 02 Sep 2023 13:28:09 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qcQfZ-007is4-In for pgsql-admin@lists.postgresql.org; Sat, 02 Sep 2023 13:28:09 +0000 Received: from mout-u-204.mailbox.org ([2001:67c:2050:101:465::204]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qcQfU-002Xhd-He for pgsql-admin@lists.postgresql.org; Sat, 02 Sep 2023 13:28:08 +0000 Received: from smtp102.mailbox.org (smtp102.mailbox.org [10.196.197.102]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-u-204.mailbox.org (Postfix) with ESMTPS id 4RdG1B61Lvz9sRZ; Sat, 2 Sep 2023 15:27:58 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ewie.name; s=MBO0001; t=1693661278; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=OB4sYERV4D6NAwSbxgdrZzf9PlQNjAiMkDIFIjtKLhc=; b=FbPpgIU5E20MtvdghXI8jnHIsi6sYJ3u5toWL4iTRiOfR56OP7K52Rv2NZfbghqiRexlq2 841A8aFv0ux0Pn2+ttFV4dOa93CdOw+i3oUxhakjy3ReOM+OSQQXN35Q2Qfd31nJciS+l5 EE2MI/f1odDRpM8jqCh37DFc2bvaM6WhAmaA3q1LZpkB1NKJ+8H2zkRfZpFohjoedUhHvq Xl1KNa+xO7FowzXG3MvI2yYMf/TXtMZKKp6bTKuFzSktBXIWg0yusoQzdSlhegle6Kt6Ft VCt/wdCXDbMZT49W42rhySEFgk3mRVTKuWoXZuntJ4FaN2MM2cLeG48mOrQ1jA== Date: Sat, 2 Sep 2023 15:27:57 +0200 (CEST) From: Erik Wienhold To: Daulat , pgsql-admin Message-ID: <1504262683.74455.1693661277706@office.mailbox.org> In-Reply-To: References: Subject: Re: DBLINK Error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Priority: 3 Importance: Normal List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 02/09/2023 09:50 CEST Daulat 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 a= nd > owner=C2=A0postgres 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=3D# Does root also have a .pgpass file? Otherwise this looks like user postgre= s is configured with trust authentication (at least on database postgres) if the= re'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=3D# Does it accept any password? That would be the case for trust authenticati= on. > ERROR: > ----------- > > cd /opt/PostgreSQL-14/bin/ > [postgres@DMM-MT bin]$ ./psql -U postgres -d tn2_demo_10 > > tn2_demo_10=3D# select * from ucf.dblink_connect_u('conn','dbname=3D"ADT_= DEM_DB"'); > ERROR: could not establish connection > DETAIL: connection to server on socket "/tmp/.s.PGSQL.5432" failed: fe_se= ndauth: 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 matchi= ng entry for the connection. -- Erik