Re: issue with reading hostname

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Atul Kumar <akumar14871(at)gmail(dot)com>
Cc: pgsql-general <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: issue with reading hostname
Date: 2024-04-22 21:54:57
Message-ID: CAKFQuwYbhNnepQgWX_fnB-BhFp-+ujLwhYoWs_p9wdVYSsO5eg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Apr 22, 2024 at 1:14 PM Atul Kumar <akumar14871(at)gmail(dot)com> 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.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2024-04-22 21:56:44 Re: CLUSTER vs. VACUUM FULL
Previous Message Atul Kumar 2024-04-22 21:54:12 Re: issue with reading hostname