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 1rz1MD-001Xqx-CG for pgsql-general@arkaria.postgresql.org; Mon, 22 Apr 2024 21:37:49 +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 1rz1MC-0002Oa-12 for pgsql-general@arkaria.postgresql.org; Mon, 22 Apr 2024 21:37:48 +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 1rz1MB-0002OR-MT for pgsql-general@lists.postgresql.org; Mon, 22 Apr 2024 21:37:47 +0000 Received: from mail-vk1-xa34.google.com ([2607:f8b0:4864:20::a34]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rz1M9-002PYj-Le for pgsql-general@postgresql.org; Mon, 22 Apr 2024 21:37:47 +0000 Received: by mail-vk1-xa34.google.com with SMTP id 71dfb90a1353d-4dac5a3fbeaso1397687e0c.3 for ; Mon, 22 Apr 2024 14:37:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713821864; x=1714426664; darn=postgresql.org; h=cc:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=qhule7lFLquOi9D2G2qWw9DONQCuleYiiaMtaF+HwEU=; b=MMsK/5R//j5/kWa+Lg/myqITz0n7djK7sbgvUTGJVxSkWRr0L3Ke1uTj9UMikrcqGb eIbviMVIwPWZVGGukp7iRE1FFS2ViJaQDPerQWakyoyEQubwjd6Zu5sGH8SJ6gXp9X2u uzmb3NgoU342YJrIY/P7YxqZ4lIu0s2iTQZ8uYhjFR6TzeXkKd6kukNQVSSt+5Ycr5yz i1AlKQKL22GecR9q9b0bs/y+pEx1y1NUyissxy7gyGMGSf4vlakc7+f/0WOCTTMtzgUx oJSvXjC/IWRzdjIH2ALnWBXqNK20WlxEltgStQdJ7b7eCDPJhvkK8zVZzsZcwG8oTRj/ pWiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713821864; x=1714426664; h=cc:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=qhule7lFLquOi9D2G2qWw9DONQCuleYiiaMtaF+HwEU=; b=iVsjbFyIHpJ6PuUdj8XGABBAxcy+e7JvjViWSZR2fNWzicEi4XnpohXktq1GDv1mMv tR3Utb4TSWk+1qXovxNEZWJl9gGyvYKVs3nMGMFYOU09OFGiVxxkIhoqZtyRn7N99rSx x1qmIGt7jZJuYDbsUBpkdXag3OdomzvqsPzExbf2xsKzHtdVlexhD6Vl2a3ZFChjywBT 3Ku6mLxkEAgLpMCK1GXkQ6L7310ugBlz8N+Pk2NgUHNqpGqIhNdm2gJBngB+FcWJwn4i g3PUucK1P9mJzVguxfhB4qlhj7T+7LBKHpJpnODzb6GDWbBbiPJlxOT1KO+EKfKuhkSB 2mIQ== X-Gm-Message-State: AOJu0Yxfwza3NQKpHndt2pwjMlRRW8f2fju9zyvuF52sgwZNExE+2x1x 021Fb30jY65tjLMQvSQxWhIZBo8ORVkWh0tFFVaATs0+Ytx/lkj3RVkl23i6RsFLQmi5ny4PUzs a1QghoQyUoEgSDo30u7hu/tOKFZLeBA== X-Google-Smtp-Source: AGHT+IGRI44kWK3RH7HDNObKK1Hdfmx+hjZYpf93AwKGT4A/00sNejMo0ddPOlVFgbPmGIV7/hDPP85zrpsQla501fM= X-Received: by 2002:a05:6122:c92:b0:4d4:1fe2:c398 with SMTP id ba18-20020a0561220c9200b004d41fe2c398mr8645085vkb.2.1713821863622; Mon, 22 Apr 2024 14:37:43 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Atul Kumar Date: Tue, 23 Apr 2024 03:07:32 +0530 Message-ID: Subject: Re: issue with reading hostname Cc: pgsql-general Content-Type: multipart/alternative; boundary="00000000000063c5400616b63f8a" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --00000000000063c5400616b63f8a Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Can we edit the socket to change the hostname in it ? Regards. On Tue, Apr 23, 2024 at 2:41=E2=80=AFAM Ron Johnson wrote: > On Mon, Apr 22, 2024 at 4:14=E2=80=AFPM Atul Kumar wrote: > >> Hi, >> >> I have postgresql version 15 running on centos7. >> >> I have below query that reads hostname from /tmp directory: >> >> psql postgres -A -t -p 5432 -h /tmp/ -c 'SELECT pg_is_in_recovery();' >> > > If you installed from the PGDG repository (possibly also the CENTOS repos= , > but I'm not sure), then the domain socket also lives in : > /var/run/postgresql > > * I find that more expressive than /tmp. > * No need to specify the host when using sockets. > * Using a socket name makes parameterizing the hostname easier in scripts= . > > > --00000000000063c5400616b63f8a Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Can we edit the socket to change the hostname in it ?
=
Regards.

On Tue, Apr 23, 2024 at 2:41=E2=80=AFAM Ron J= ohnson <ronljohnsonjr@gmail.c= om> wrote:
On Mon, Apr 22, 2024 at 4:14=E2=80=AFPM= Atul Kumar <= akumar14871@gmail.com> wrote:
Hi,

I have postgresql=C2=A0 version 15 running on centos7.

I have below query that reads hostname from /tmp dire= ctory:

psql postgres -A= -t -p 5432 -h /tmp/ -c 'SELECT pg_is_in_recovery();'=


If you installed from the = PGDG repository (possibly also the CENTOS repos, but I'm not sure), the= n the domain socket also lives in :
/var/run/postgresql

* I find that more expressive than /tmp.
* No nee= d to specify the host when using sockets.
* Using a socket name m= akes parameterizing the hostname easier in scripts.


--00000000000063c5400616b63f8a--