Re: HOST variable in psql - Mailing list pgsql-general

From Paul Förster
Subject Re: HOST variable in psql
Date
Msg-id 7053E680-139C-40D3-8F8A-68A4EFB10D4C@gmail.com
Whole thread Raw
In response to Re: HOST variable in psql  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
Hi Tom,

> On 27. Apr, 2020, at 15:13, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> [ shrug... ]  When connecting via a Unix socket, psql does not have a
> relevant "hostname" to report, so it reports what it's got.  You are
> ascribing a meaning to HOST that it does not have, never has had, and
> never can have in this case.

I'm not much of a C programmer, but there's AFAIK a C function to get the hostname. So it should IMHO be easy to put
somethinginto the psql init (and \c) code that calls the function and set the HOST variable accordingly. IMHO... 

> There has been some talk of providing a way to execute stuff on reconnect,
> if memory serves, but nothing's been done about it.

thought so. So I'll have to work around that.

Thanks,
Paul


pgsql-general by date:

Previous
From: Matthias Apitz
Date:
Subject: Re: PostgreSQL client hangs sometimes on 'EXEC SQL PREPAREsid_sisisinst FROM :select_anw;'
Next
From: Tom Lane
Date:
Subject: Re: PostgreSQL client hangs sometimes on 'EXEC SQL PREPARE sid_sisisinst FROM :select_anw;'