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 1rz1TB-001YMs-QJ for pgsql-general@arkaria.postgresql.org; Mon, 22 Apr 2024 21:45:01 +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 1rz1TA-000Fk2-HC for pgsql-general@arkaria.postgresql.org; Mon, 22 Apr 2024 21:45:00 +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 1rz1TA-000Fji-6N for pgsql-general@lists.postgresql.org; Mon, 22 Apr 2024 21:45:00 +0000 Received: from mail-oa1-x36.google.com ([2001:4860:4864:20::36]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rz1T7-002Pbr-Bx for pgsql-general@postgresql.org; Mon, 22 Apr 2024 21:44:59 +0000 Received: by mail-oa1-x36.google.com with SMTP id 586e51a60fabf-23a46c472feso644290fac.2 for ; Mon, 22 Apr 2024 14:44:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713822295; x=1714427095; 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=ewL9dGcGj5TuMBJ+1+gu+KBwECFTbYxHHCWqOKJEggQ=; b=TmyYO1/FisPeiWSnFe3ZdFfrT7YUjQTMfumf/WlSc7HrMJhMVnugh3EZwqgMD/RXII LPd8mEAuTTrXla4xsMD6AK5bBCePoHDwf8PcsvcC8tWXpuiM28KMAe+mztlrFLIBgKVS mIYl/TKL+SzIoUmj49QWafy27OWxAwaNoUfzLyT/YFl2u1pxYZFMeV8KCS9sR50xQ+fm Od0ITTfwIB3KIhRxFQnEe77LIINy5QeixHOuq0kvbxwiERiNdbjygOioAr8HNAi7w87Q 65gMFhUcGy7BGi0Wjd3K83GEAs8lh/mjBkBm8CZ9c0r0x7Zqpwb6PddS0yxZOuMb+k2n 6Udg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713822295; x=1714427095; 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=ewL9dGcGj5TuMBJ+1+gu+KBwECFTbYxHHCWqOKJEggQ=; b=FdrTGQxqPXvwhUafztXO8ztfAP3ySkwvAIdK+7CafocsLuuHkVxS395VT6WjxX9Jx7 tr7OlIuUte5ANeCwk3bga+3+MA70/3dqUlRgivV7Q5mxvHewsGq9yU9VmDZfvfX4CtDi t6TDuKvfaTbtsx4ifwc5FjngjTxsoKdQfWZQFLvFuZVJE68EeeeQleRoiT0vXL2pS0Fn bVex5hB8OMnEC4pOvDhh0tS7ilMBAAT9cFgJXN7JocPnCblwPEJoVbKZRaYWQFWGBPAF V1JsD7g5KoNWX+nWpK5fGjwr3tVs7eCG1m/P6t9kLX9XYRnumC6NLoW/LdzYbvhS/Q8c /chA== X-Gm-Message-State: AOJu0YzLzf4hxPo0StILXVnBE9nLy/m92/OkMCXuwpM17xfQkkZfRQTv vPHNNJ2ZfCm/A9HrXN9DCnCvW8KbH/4AJq7wQQtgptWNgh6gMp6sVaQ++sX7ppHRKjZXaKgTTYS IycN7gytKFXQC2DDZqaDLciaFcfykajPb X-Google-Smtp-Source: AGHT+IHH7Tj6cUYJeq4vOkNfFpnDe1HWjA1Icx8srSFR0noOiKrmhdqzPADJI6gkU3CE6/EnYFmvQBK2NqhsJiQKXnQ= X-Received: by 2002:a05:6871:e408:b0:22e:7390:da7 with SMTP id py8-20020a056871e40800b0022e73900da7mr14091562oac.21.1713822295152; Mon, 22 Apr 2024 14:44:55 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Ron Johnson Date: Mon, 22 Apr 2024 17:44:43 -0400 Message-ID: Subject: Re: issue with reading hostname To: pgsql-general Content-Type: multipart/alternative; boundary="0000000000001c5ffa0616b6591b" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000001c5ffa0616b6591b Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable There's no hostname in a socket directory. Do you mean :"change the socket name from /tmp or /var/run/postgresql to something else?" If so, then https://www.postgresql.org/docs/16/runtime-config-connection.html mentions sockets. On Mon, Apr 22, 2024 at 5:37=E2=80=AFPM Atul Kumar = wrote: > 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 script= s. >> >> >> --0000000000001c5ffa0616b6591b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
There's no hostname=C2=A0in a socket directory.

Do you mean :"change the socket name from /tmp= or /var/run/postgresql to something else?"



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 directory:

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


If you inst= alled from the PGDG repository (possibly also the CENTOS repos, but I'm= not sure), then the domain socket also lives in :
/var/run/postg= resql

* 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.


--0000000000001c5ffa0616b6591b--