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

From Paul Förster
Subject Re: HOST variable in psql
Date
Msg-id 0767EAE6-86F3-45D8-87B5-4A9275E3E924@gmail.com
Whole thread Raw
In response to Re: HOST variable in psql  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: HOST variable in psql
List pgsql-general
Hi Tom,

> On 27. Apr, 2020, at 14:20, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> AFAICS, psql is behaving as documented.  Why are you trying to override
> HOST like that, instead of just using some other variable?

I could but

a) HOST is HOST and should not point to a socket directory. A socket directory is not a HOST. This makes no sense,
especiallysince I see no use for using a socket directory in any psql script. There are tons of use cases for the
hostname,though. 

b) it would require changing some scripts.

c) the docs are IMHO not 100% clear on this. I think the psqlrc should be executed on EVERY new connect, hence
including\c, and this is how I interpret the docs too. But it doesn't... 

also (slightly related) d) PostgreSQL unfortunately does not provide any functionality to determine the server hostname
itruns on. There is an extension but I still don't see why PostgreSQL does not include this natively. 

Cheers,
Paul


pgsql-general by date:

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