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 1rz0wt-001W6d-Ew for pgsql-general@arkaria.postgresql.org; Mon, 22 Apr 2024 21:11:39 +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 1rz0wr-00GrsI-Or for pgsql-general@arkaria.postgresql.org; Mon, 22 Apr 2024 21:11:37 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rz0wr-00GrqK-Ds for pgsql-general@lists.postgresql.org; Mon, 22 Apr 2024 21:11:37 +0000 Received: from mail-ot1-x331.google.com ([2607:f8b0:4864:20::331]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rz0wp-00497Q-4h for pgsql-general@postgresql.org; Mon, 22 Apr 2024 21:11:36 +0000 Received: by mail-ot1-x331.google.com with SMTP id 46e09a7af769-6e9e1a52b74so1006502a34.0 for ; Mon, 22 Apr 2024 14:11:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713820294; x=1714425094; darn=postgresql.org; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=teFOkXYWuNjNLFHPrPjSXlQPYseVX2OxX2AXF+XZoBY=; b=aOviE4UFJP3d1oZDbuCda2eXerfqHiMJzTLR1r0J5b4kojnX4LHR30jn/5gdJiOPlP CROqjJfNBYGXH/6ZvETE6WOU+C1aN+Hi6VzKxVZziL7YYotYysPmXEiLxJ7MbDv0uusN 9uM28EOFQ5Phzf+mnWfePcP8/YBdXR2usGNOrXyzzfqhO9yjM9SB496maAi/DLYlS7z2 pnZgq/Jtu66BfeLE/JKOrLYZltWnrEQIk61ZQsXQHAKCulEczxgDNSR3lJ9MO16pC1pL S9adKf2hnOEydl7KswZcDupvPOnw7/dO9XgSJUm/nHMVDsGiJf1koMbUpmuMe5dfBUZe OFFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713820294; x=1714425094; h=to: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=teFOkXYWuNjNLFHPrPjSXlQPYseVX2OxX2AXF+XZoBY=; b=DF2Ec/FSnzXYxX7nrW0JZgP1Fq9GJmvpJ2/KZrWAYSUb2sRA9bpXVqRBWU65sA9mVF fKRLFSScq0uQ7o4QYMqhYbBbssWCuPleo9URhBmBgTtGLk7nx8BeKCHLHyl74HMvQkTq 3y0ai5HMAIrQzCCNI48JDRLVZJobu3AYH/qA6ePLpXC9iA2o/h1buRzH44HS6whPvxO6 Rz7reeIku5J/iFYJ0oJwHeZnVsnW7oq9u/LlMFKLYDBcuH2gGhiPjRmfK6pu6MF9dBDI jLyY1lO54fjDLY/kflqCDowUuur7TuDORgyB3WhCRThcfaSjYlJVKkZh4m+VorCu4PQd xHBw== X-Gm-Message-State: AOJu0YzAWuHqYZoUJwVGKpX08gBYtab5JB4VlIbVNp+lolQ5IURcXWxE Y8c+SgFM7TcbgayLc9lezPlXUvWQ6BDOP/o4wJN/u/8VIC307IOZVNMoPBpfWdiH1XgPmEN0Hzb QOMwEGDp7Gk8DQCnScLuC7KY7Eugpkw== X-Google-Smtp-Source: AGHT+IEKOuc4Ltuz1J9X4uDfMB52Gk7cnBktKoayFT9MBliCLeCBQbXQeWxbS+0qfG3a5LYEWw18ep+WP7ka5GCsaLQ= X-Received: by 2002:a05:6870:709d:b0:234:56c5:9fa5 with SMTP id v29-20020a056870709d00b0023456c59fa5mr14633968oae.57.1713820294080; Mon, 22 Apr 2024 14:11:34 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Ron Johnson Date: Mon, 22 Apr 2024 17:11:22 -0400 Message-ID: Subject: Re: issue with reading hostname To: pgsql-general Content-Type: multipart/alternative; boundary="000000000000d6711d0616b5e186" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000d6711d0616b5e186 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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. --000000000000d6711d0616b5e186 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Mon, Apr 22, 2024 at 4:14=E2=80=AFPM A= tul Kumar <akumar14871@gmail.co= m> wrote:
Hi,

I h= ave postgresql=C2=A0 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 (pos= sibly 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 hos= t when using sockets.
* Using a socket name makes parameterizing = the hostname easier in scripts.


--000000000000d6711d0616b5e186--