Re: issue with reading hostname - Mailing list pgsql-general

From David G. Johnston
Subject Re: issue with reading hostname
Date
Msg-id CAKFQuwYbhNnepQgWX_fnB-BhFp-+ujLwhYoWs_p9wdVYSsO5eg@mail.gmail.com
Whole thread Raw
In response to issue with reading hostname  (Atul Kumar <akumar14871@gmail.com>)
List pgsql-general
On Mon, Apr 22, 2024 at 1:14 PM Atul Kumar <akumar14871@gmail.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.

pgsql-general by date:

Previous
From: Atul Kumar
Date:
Subject: Re: issue with reading hostname
Next
From: Adrian Klaver
Date:
Subject: Re: CLUSTER vs. VACUUM FULL