Skip site navigation (1) Skip section navigation (2)

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

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: David Christensen <david(at)endpoint(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Steve Singer <ssinger_pg(at)sympatico(dot)ca>, pgsql-hackers Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: psql \conninfo command (was: Patch: psql \whoami option)
Date: 2010-07-21 10:29:38
Message-ID: AANLkTi=Ht4rrPmn5GF8Mr6W68LV_A2irkro0EcczM_ZL@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-hackers
On Wed, Jul 21, 2010 at 1:07 AM, Fujii Masao <masao(dot)fujii(at)gmail(dot)com> wrote:
> On Tue, Jul 20, 2010 at 11:14 PM, Robert Haas <robertmhaas(at)gmail(dot)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".

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

In response to

Responses

pgsql-hackers by date

Next:From: KaiGai KoheiDate: 2010-07-21 10:35:58
Subject: Re: leaky views, yet again
Previous:From: Robert HaasDate: 2010-07-21 10:26:43
Subject: Re: leaky views, yet again

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group