Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qBtOc-0005x0-Jc for pgsql-general@arkaria.postgresql.org; Wed, 21 Jun 2023 08:40:58 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1qBtOa-0005lf-L8 for pgsql-general@arkaria.postgresql.org; Wed, 21 Jun 2023 08:40:56 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qBtOa-0005lV-5r for pgsql-general@lists.postgresql.org; Wed, 21 Jun 2023 08:40:56 +0000 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qBtOX-003mo5-Hu for pgsql-general@lists.postgresql.org; Wed, 21 Jun 2023 08:40:55 +0000 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-3f9b258f3a2so31473015e9.0 for ; Wed, 21 Jun 2023 01:40:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20221208.gappssmtp.com; s=20221208; t=1687336851; x=1689928851; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:from:to:cc:subject:date :message-id:reply-to; bh=0HwxAaTNS+zkxxm/HND3GVeQm6UFrYGjM63HGdgS9uw=; b=SnjWd3+qnso6xTblFMGjoo2rtoe010IFrq2taKz0g8ay4AS8h5uM4JZnt1cRwSMfRC 6DQ5cOokMXrSaRlhdFZbHAWfv/OLN+w/4VtIGYUJoz1CrkQirfGCMEXBFYwktyYJH4fE 4r3shdTDsC/WlvM+5DxLMP/c3K5xmTqYdB7uYCrgOtA33fBJByt0hf3Uvht7e2X0SiFg m/M1zGvWKkBmP0yLXn9OLJme07S0ZlZx1UgR9caz1/tOIMYdPEb2n5l0k8KlLPrjbyKP vaMFd5TcuxPmGgFy7JGe0/VDACHHOVpHVv2MQAOCxoyVg8G7DzOEZKJJ19jFwHovQpgE eEGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687336851; x=1689928851; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=0HwxAaTNS+zkxxm/HND3GVeQm6UFrYGjM63HGdgS9uw=; b=ls8QFkWaAniLfZCcvyO8OFXGI0E5vN6SxL9flG4pWlRjGunrEMOOabodBMjv48YbhR ITmwXOBe0cnG78cW399rfAc4JJDAN64kWYDOpdjDz0WILtD6LXRz/x3BZIOtIrJu1pES 3iT1B5Iy+rJKM22ARs8aTVNRnAEyFwLSvc64pT23wNqlUlPREYQOOtW0nLv216ZmatuA fcZeoS82lnAoKvFnTT92MgMt5V3o/uI0/p3ufTBjIZkya/f4Zmb/xxm5OWJV6V271HkZ mqPiZ1aqbZeItsz9JRCGeaCZzDUmBTpgTqGmJ0yAIao4vS+g6J7PRvLQU+uIcyDwbCAo /4CA== X-Gm-Message-State: AC+VfDxDxEX9eMsPPtRaptT9SqPlsWIlJnaD9dVfyXbjhDrY8nvhR5AX MK5EdMmZS0kkBgNs/7Rz8pbmCA== X-Google-Smtp-Source: ACHHUZ5PG+EEsIFWzayRMqdJ7MFO0CbtxUFPc/h8VjM7CJ9yK2cufWSM9dJkrNqA2vWJpoOVg/DnwA== X-Received: by 2002:a1c:7708:0:b0:3f9:ba2:5d1c with SMTP id t8-20020a1c7708000000b003f90ba25d1cmr8565892wmi.9.1687336851409; Wed, 21 Jun 2023 01:40:51 -0700 (PDT) Received: from localhost.localdomain ([2001:871:5e:3a4d:f2a0:fef3:7aeb:6c99]) by smtp.gmail.com with ESMTPSA id o10-20020a1c750a000000b003f604793989sm1918303wmc.18.2023.06.21.01.40.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Jun 2023 01:40:51 -0700 (PDT) Message-ID: <4354019843b27c9b88aa666398d438c4e2daf6ab.camel@cybertec.at> Subject: Re: strange behavior of .pgpass file From: Laurenz Albe To: Atul Kumar , pgsql-general Date: Wed, 21 Jun 2023 10:40:50 +0200 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.46.4 (3.46.4-1.fc37) MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, 2023-06-21 at 00:29 +0530, Atul Kumar wrote: > I found some strange behaviour of postgres superuser password in my exist= ing cluster, below is the basic outline of the setup. > 1. version - postgres 12 > 2. replication - streaming replication async > 3. OS- centos7 > 4. One Master, One Standby >=20 > I have identical pgpass files on both server postgres home directory. >=20 > So when I execute below command on slave node: > psql -h slave_hostname/ip -U postgres -d postgres -p 5432 -c "select pg_i= s_in_recovery" >=20 > I get error of password authentication: >=20 > psql: error: FATAL:=C2=A0 password authentication failed for user "postgr= es" > password retrieved from file "/homedirectorypath/.pgpass" >=20 > But when I run the same command on master node: > psql -h slave_hostname/ip -U postgres -d postgres -p 5432 -c "select pg_i= s_in_recovery" >=20 > I don't get any errors and get the expected output as "t". >=20 > Note: the passwords in and path of both=C2=A0pgpass files are identical. >=20 > then why am I getting errors on the slave node for the same command even = after having everything the same ? pg_hba.conf could be different on both servers. Yours, Laurenz Albe