pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Paul Förster <paul.foerster@gmail.com>
Cc: pgsql-general <pgsql-general@postgresql.org>
Subject: Re: HOST variable in psql
Date: Mon, 27 Apr 2020 09:13:11 -0400
Message-ID: <9170.1587993191@sss.pgh.pa.us> (raw)
In-Reply-To: <0767EAE6-86F3-45D8-87B5-4A9275E3E924@gmail.com>
References: <91ADA44B-9EFA-4784-A45F-8323B3F552B3@gmail.com>
	<3325.1587990006@sss.pgh.pa.us>
	<0767EAE6-86F3-45D8-87B5-4A9275E3E924@gmail.com>

=?utf-8?Q?Paul_F=C3=B6rster?= <paul.foerster@gmail.com> writes:
>> 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, especially since I see no use for using a socket directory in any psql script. There are tons of use cases for the hostname, though.

[ 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.

> 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...

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

			regards, tom lane





view thread (5+ messages)  latest in thread

Message-ID: <9170.1587993191@sss.pgh.pa.us>
Permalink:  ../9170.1587993191@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/9170.1587993191@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: tgl@sss.pgh.pa.us, paul.foerster@gmail.com
  Subject: Re: HOST variable in psql
  In-Reply-To: <9170.1587993191@sss.pgh.pa.us>
  References: <91ADA44B-9EFA-4784-A45F-8323B3F552B3@gmail.com> <3325.1587990006@sss.pgh.pa.us> <0767EAE6-86F3-45D8-87B5-4A9275E3E924@gmail.com> <9170.1587993191@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox