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 1rz1dT-001Z5e-D5 for pgsql-general@arkaria.postgresql.org; Mon, 22 Apr 2024 21:55: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 1rz1dS-000aVb-03 for pgsql-general@arkaria.postgresql.org; Mon, 22 Apr 2024 21:55:38 +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 1rz1dR-000aQn-KM for pgsql-general@lists.postgresql.org; Mon, 22 Apr 2024 21:55:37 +0000 Received: from mail-oa1-x29.google.com ([2001:4860:4864:20::29]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rz1dP-0049YS-92 for pgsql-general@lists.postgresql.org; Mon, 22 Apr 2024 21:55:36 +0000 Received: by mail-oa1-x29.google.com with SMTP id 586e51a60fabf-23a6a8e9978so508789fac.3 for ; Mon, 22 Apr 2024 14:55:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713822934; x=1714427734; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=K/+aGIdGfSsqF7BroDuS9GXlFhfSxPP8LozuqqL55fY=; b=Cd+q5GvuOOozDLp5ShJ4Vr+1CrRnJkEW30Aalwk3MhLQUadqAblqnwTo4X4gcDb1CE w5XpSD/9MY7mQu/KMqx+j1ii9BLDLN9bn9B5laYORCwLjcS8nvvkYHjwwxmYW4c7sM4W WJfGYFCxoGwfpKXjPUttNieUslDpYNIoMpWpmrMkaIPdL4zUth7yX3wPsM0G8vCl4ioL qVM11HeyMYue2EealqKcgrYtj4TdQbeLry2g/qa1fFvkoCF3g2YLrS4zNgx9llK4qQMG ntejnqeZZaJ9koeHZqTbNvsbhlJ/6yfa8ZmDWhNqSm2POq93zPwRjbFx7txV+yEM3FHQ D31w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713822934; x=1714427734; h=cc: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=K/+aGIdGfSsqF7BroDuS9GXlFhfSxPP8LozuqqL55fY=; b=ic2G7xXW+USTEshi0rjszIjsgQ37ODi/A1ScRi7qxQ1MkUzVTGFbgKz5PzchA0HZ9c r/oKDyXUxDI1ttOv0nh36ABF5EtWSnFpjOoZwAtkSRLueMnMtVyZKgmv0bjQGdb416gV Fzdwc1KtGk8zUJAwz50GtlMU2qS50vYM8ekMDvSdYxTUp3DcV85YP4OwUAQsndAQ4Tmn UC/iYAz2ah7+b4SXQ7IMqlMophMX5Pd6oneEtilI/FyMbWSS4Lg3uxS8VRSkdALdkwwc yckq5IhuXzhWLoA3a5m9Mf/k1CRNZr0V91U7We3U/fw9NzDjMoGCaEWZ98W1xhL9aE1E zjbA== X-Gm-Message-State: AOJu0YzZshzrJCECd/2dihOxKlftkv81xhjJ7nV6EJjdT2XEdYMvXBtW Fy60yFv/DfPCj+eoKFxg4xty+gOt2e35UtOu6YmpSxncfXEEZjDM/5Gl2ejHVNA/1mx7TjnO/xr ySG7L40klOVn0MRTXbyBHv5gWuMI= X-Google-Smtp-Source: AGHT+IE5g+lRAVcMcYYwTTtbTDM8+VJk0x8cHJ06FLsPNSLuGpnVVGONdpjFB6UNIAoWWxnR0K16l9nE27t+x+/jBks= X-Received: by 2002:a05:6870:1641:b0:232:f991:8fc4 with SMTP id c1-20020a056870164100b00232f9918fc4mr17077127oae.46.1713822934596; Mon, 22 Apr 2024 14:55:34 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: "David G. Johnston" Date: Mon, 22 Apr 2024 14:54:57 -0700 Message-ID: Subject: Re: issue with reading hostname To: Atul Kumar Cc: pgsql-general Content-Type: multipart/alternative; boundary="0000000000003985d20616b67f09" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000003985d20616b67f09 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Apr 22, 2024 at 1:14=E2=80=AFPM Atul Kumar = wrote: > > so below are my questions: > > 1. Is the psql client reading the socket file that resides in the /tmp > directory to fetch the hostname ? > > 2. I saw the socket file in /tmp and it is empty. Then how is the psql > client still reading the socket file successfully for hostname ? > > > Unix sockets are not a PostgreSQL-specific thing, they are an OS thing. You should be able to find information on them if you search but it isn't something our documentation is on the hook to teach. But, in many ways, it is just a file name (Unix philosophy, everything is a file) that programs can hook their standard input and standard output up to such that the standard output sent by one process is directed to the standard input of the other process. All on the fly, nothing gets persisted into the physical file. It's a tin-can-and-string solution to interprocess communication. David J. --0000000000003985d20616b67f09 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Mon, Apr 22, 2024 at 1:14=E2=80=AFPM Atul Kumar <akumar14871@gmail.com> wrote:<= /span>


so below are my questions:

1. Is the psql client reading the socket file that resides in= the /tmp directory to fetch the hostname ?

2. I saw the socket file in /tmp and it is empt= y. Then how is the psql client still reading the socket file successfully= =C2=A0for hostname ?



Unix sockets are not a PostgreSQL-specific thi= ng, they are an OS thing.=C2=A0 You should be able to find information on t= hem if you search but it isn't something our documentation is on the ho= ok to teach.

But, in many ways, it is just a file name= (Unix philosophy, everything is a file) that programs can hook their stand= ard input and standard output up to such that the standard output sent by o= ne process is directed to the standard input of the other process.=C2=A0 Al= l on the fly, nothing gets persisted into the=C2=A0physical file.=C2=A0 It&= #39;s a tin-can-and-string solution to interprocess communication.
=
David J.

--0000000000003985d20616b67f09--