=?utf-8?Q?Paul_F=C3=B6rster?= <paul.foerster@xxxxxxxxx> writes: > the use of :HOST in psql containing the socket directory for local connections is pretty useless for us, so we set it to the 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 the database cluster, then :HOST gets reset to the socket directory. On the one hand, this makes sense, on the other, the global 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