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

From Tom Lane
Subject Re: HOST variable in psql
Date
Msg-id 3325.1587990006@sss.pgh.pa.us
Whole thread Raw
In response to HOST variable in psql  (Paul Förster <paul.foerster@gmail.com>)
Responses Re: HOST variable in psql
List pgsql-general
=?utf-8?Q?Paul_F=C3=B6rster?= <paul.foerster@gmail.com> writes:
> the use of :HOST in psql containing the socket directory for local connections is pretty useless for us, so we set it
tothe hostname in a global psqlrc file: 
> \set HOST `hostname -s`
> This works great when invoking psql on the command line. But if I perform a \c to connect to a different database in
thedatabase cluster, then :HOST gets reset to the socket directory. On the one hand, this makes sense, on the other,
theglobal psqlrc file does not seem to be executed again, thus leaving :HOST in an unuable state for us: 

AFAICS, psql is behaving as documented.  Why are you trying to override
HOST like that, instead of just using some other variable?

            regards, tom lane



pgsql-general by date:

Previous
From: Magnus Hagander
Date:
Subject: Re: PostgreSQL Server version compatibility check with Window 2016
Next
From: Matthias Apitz
Date:
Subject: PostgreSQL client hangs sometimes on 'EXEC SQL PREPARE sid_sisisinst FROM :select_anw;'