From: | Steve Crawford <scrawford(at)pinpointresearch(dot)com> |
---|---|
To: | Cal Heldenbrand <cal(at)fbsdata(dot)com> |
Cc: | Francisco Olarte <folarte(at)peoplecall(dot)com>, Achilleas Mantzios <achill(at)matrix(dot)gatewaynet(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: psql color hostname prompt |
Date: | 2016-04-26 16:02:49 |
Message-ID: | CAEfWYyygPofj3HOLZW1YfWG_BD05NJddoZGKHbX4OgKmXQZuVw@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
>
> 2) %M vs shell call
>
> %M on when connected to the local machine displays the string "[local]"
> which I didn't like. I wanted a real hostname to show no matter which
> client/server pair I was using. Zero chance for mistaken commands on the
> wrong host. Many times we ssh to a remote server, then run psql locally.
>
> Perhaps the more elegant route here, is to change psql's behavior with %M
> when connected to the local machine? (This would also solve point #3)
>
>
There is a basic problem - what is the hostname?
1.2.3.4? db23.example.com? server42? 127.0.0.1? 192.168.54.23? Those could
all be the same PostgreSQL instance, all different or some mix. And we
haven't even considered local Unix connections, servers running on
different ports and the fact that localhost is machine specific and
non-fully-qualified names that depend on resolver search orders.
One possible solution would be to essentially do the reverse of
application_name. I.e. do something along the lines of adding a server-side
parameter to specify the name of the server instance that would be
exchanged in the startup handshake and made available to client processes.
I could see some value in that but can't speak to the work and possible
wire-protocol breakage that might be involved relative to the benefits.
Cheers,
Steve
From | Date | Subject | |
---|---|---|---|
Next Message | George Neuner | 2016-04-26 16:12:15 | Re: Columnar store as default for PostgreSQL 10? |
Previous Message | Cal Heldenbrand | 2016-04-26 15:20:48 | Re: psql color hostname prompt |