Re: HOST variable in psql

From: Paul Förster <paul(dot)foerster(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: HOST variable in psql
Date: 2020-04-27 13:38:16
Message-ID: 7053E680-139C-40D3-8F8A-68A4EFB10D4C@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi Tom,

> On 27. Apr, 2020, at 15:13, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)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 something into 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2020-04-27 13:40:39 Re: PostgreSQL client hangs sometimes on 'EXEC SQL PREPARE sid_sisisinst FROM :select_anw;'
Previous Message Matthias Apitz 2020-04-27 13:19:55 Re: PostgreSQL client hangs sometimes on 'EXEC SQL PREPARE sid_sisisinst FROM :select_anw;'