Re: psql \conninfo command (was: Patch: psql \whoami option)

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: psql \conninfo command (was: Patch: psql \whoami option)
Дата
Msg-id AANLkTikptCEqXE45-WDE6LaRitprR4x7BGyy6zCsVJ5C@mail.gmail.com
обсуждение исходный текст
Ответ на Re: psql \conninfo command (was: Patch: psql \whoami option)  (David Christensen <david@endpoint.com>)
Список pgsql-hackers
On Wed, Jul 21, 2010 at 10:09 PM, David Christensen <david@endpoint.com> wrote:
>
> On Jul 21, 2010, at 8:48 PM, Fujii Masao wrote:
>
>> On Wed, Jul 21, 2010 at 7:29 PM, Robert Haas <robertmhaas@gmail.com> wrote:
>>> On Wed, Jul 21, 2010 at 1:07 AM, Fujii Masao <masao.fujii@gmail.com> wrote:
>>>> On Tue, Jul 20, 2010 at 11:14 PM, Robert Haas <robertmhaas@gmail.com> wrote:
>>>>> OK, committed.
>>>>
>>>> When I specify the path of the directory for the Unix-domain socket
>>>> as the host, \conninfo doesn't mention that this connection is based
>>>> on the Unix-domain socket. Is this intentional?
>>>>
>>>> $ psql -h"/tmp" -c"\conninfo"
>>>> You are connected to database "postgres" on host "/tmp" at port "5432"
>>>> as user "postgres".
>>>>
>>>> I expected that something like
>>>>
>>>>    You are connected to database "postgres" via local socket on
>>>> "/tmp" at port "5432" as user "postgres".
>>>
>>> :-(
>>>
>>> No, I didn't realize the host field could be used that way.  It's true
>>> that you get a fairly similar message from \c, but that's not exactly
>>> intuitive either.
>>>
>>> rhaas=# \c - - /tmp -
>>> You are now connected to database "rhaas" on host "/tmp".
>>
>> OK. The attached patch makes \conninfo command emit the following
>> message if the host begins with a slash:
>>
>>    $ psql -h/tmp -c"\conninfo"
>>    You are connected to database "postgres" via local socket on
>> "/tmp" at port "5432" as user "postgres".
>>
>> Similarly, it makes \c command emit the following message in that
>> case:
>>
>>    $ psql -hlocalhost -c"\c - - /tmp -"
>>    You are now connected to database "postgres" via local socket on "/tmp".
>
>
> If we print the local socket when it's been explicitly set via the host= param, why not display the actual socket
pathin the general local socket case? 

Patch?

> Also, while we're still tweaking this patch, I've had a couple requests for the SSL status of the connection as well;
doesthis seem like a generally useful parameter to display as well? 

Yes.  If we're going to have the command, we might as well get as much
mileage out of it as we reasonably can.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise Postgres Company


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: psql \conninfo command (was: Patch: psql \whoami option)
Следующее
От: Robert Haas
Дата:
Сообщение: Re: review: psql: edit function, show function commands patch