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

2010-07-23 Thread Robert Haas
On Wed, Jul 21, 2010 at 11:13 PM, Fujii Masao wrote: > On Thu, Jul 22, 2010 at 11:57 AM, Robert Haas wrote: >> Should we be using is_absolute_path() here instead, as libpq does? > > Yes. The attached patch does that. > >>> On Wed, Jul 21, 2010 at 10:09 PM, David Christensen >>> wrote: >>> If we

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

2010-07-21 Thread Fujii Masao
On Thu, Jul 22, 2010 at 11:57 AM, Robert Haas wrote: > Should we be using is_absolute_path() here instead, as libpq does? Yes. The attached patch does that. >> On Wed, Jul 21, 2010 at 10:09 PM, David Christensen >> wrote: >> If we print the local socket when it's been explicitly set via the ho

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

2010-07-21 Thread Robert Haas
On Wed, Jul 21, 2010 at 10:09 PM, David Christensen wrote: > > On Jul 21, 2010, at 8:48 PM, Fujii Masao wrote: > >> On Wed, Jul 21, 2010 at 7:29 PM, Robert Haas wrote: >>> On Wed, Jul 21, 2010 at 1:07 AM, Fujii Masao wrote: On Tue, Jul 20, 2010 at 11:14 PM, Robert Haas wrote: > O

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

2010-07-21 Thread Robert Haas
On Wed, Jul 21, 2010 at 9:48 PM, Fujii Masao wrote: > On Wed, Jul 21, 2010 at 7:29 PM, Robert Haas wrote: >> On Wed, Jul 21, 2010 at 1:07 AM, Fujii Masao wrote: >>> On Tue, Jul 20, 2010 at 11:14 PM, Robert Haas wrote: OK, committed. >>> >>> When I specify the path of the directory for the

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

2010-07-21 Thread David Christensen
On Jul 21, 2010, at 8:48 PM, Fujii Masao wrote: > On Wed, Jul 21, 2010 at 7:29 PM, Robert Haas wrote: >> On Wed, Jul 21, 2010 at 1:07 AM, Fujii Masao wrote: >>> On Tue, Jul 20, 2010 at 11:14 PM, Robert Haas wrote: OK, committed. >>> >>> When I specify the path of the directory for the Un

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

2010-07-21 Thread Fujii Masao
On Wed, Jul 21, 2010 at 7:29 PM, Robert Haas wrote: > On Wed, Jul 21, 2010 at 1:07 AM, Fujii Masao wrote: >> On Tue, Jul 20, 2010 at 11:14 PM, Robert Haas wrote: >>> OK, committed. >> >> When I specify the path of the directory for the Unix-domain socket >> as the host, \conninfo doesn't mention

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

2010-07-21 Thread Robert Haas
On Wed, Jul 21, 2010 at 1:07 AM, Fujii Masao wrote: > On Tue, Jul 20, 2010 at 11:14 PM, Robert Haas 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.

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

2010-07-20 Thread Fujii Masao
On Tue, Jul 20, 2010 at 11:14 PM, Robert Haas 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 con

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

2010-07-20 Thread Robert Haas
On Tue, Jul 20, 2010 at 12:16 AM, David Christensen wrote: > On Jul 19, 2010, at 11:10 PM, Robert Haas wrote: > >> On Tue, Jul 20, 2010 at 12:07 AM, Robert Haas wrote: >>> On Tue, Jul 20, 2010 at 12:02 AM, David Christensen >>> wrote: > I would propose to print instead: > > You are

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

2010-07-19 Thread David Christensen
On Jul 19, 2010, at 11:10 PM, Robert Haas wrote: > On Tue, Jul 20, 2010 at 12:07 AM, Robert Haas wrote: >> On Tue, Jul 20, 2010 at 12:02 AM, David Christensen >> wrote: I would propose to print instead: You are connected to database "rhaas" via local socket as user "rhaas". >>>

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

2010-07-19 Thread Robert Haas
On Tue, Jul 20, 2010 at 12:07 AM, Robert Haas wrote: > On Tue, Jul 20, 2010 at 12:02 AM, David Christensen > wrote: >>> I would propose to print instead: >>> >>> You are connected to database "rhaas" via local socket as user "rhaas". >> >> >> One minor quibble here; you lose the ability to see w

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

2010-07-19 Thread Robert Haas
On Tue, Jul 20, 2010 at 12:02 AM, David Christensen wrote: >> I would propose to print instead: >> >> You are connected to database "rhaas" via local socket as user "rhaas". > > > One minor quibble here; you lose the ability to see which pg instance you're > running on if there are multiple ones

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

2010-07-19 Thread David Christensen
> I would propose to print instead: > > You are connected to database "rhaas" via local socket as user "rhaas". One minor quibble here; you lose the ability to see which pg instance you're running on if there are multiple ones running on different local sockets, so maybe either the port or the

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

2010-07-19 Thread Robert Haas
On Mon, Jul 19, 2010 at 11:41 PM, David Christensen wrote: >> I took a look at this patch.  One problem is that it doesn't handle >> the case where there is no database connection (for example, shut down >> the database with pg_ctl, then do select 1, then do \conninfo).  I've >> fixed that in the

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

2010-07-19 Thread David Christensen
On Jul 19, 2010, at 10:34 PM, Robert Haas wrote: > On Sun, Jul 18, 2010 at 2:00 PM, David Christensen wrote: >> Updated the commitfest entry with the patch, updated the title to reflect >> the actual name of the command, and marked as ready for committer. > > I took a look at this patch. One

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

2010-07-19 Thread Robert Haas
On Sun, Jul 18, 2010 at 2:00 PM, David Christensen wrote: > Updated the commitfest entry with the patch, updated the title to reflect the > actual name of the command, and marked as ready for committer. I took a look at this patch. One problem is that it doesn't handle the case where there is n

[HACKERS] psql \conninfo command (was: Patch: psql \whoami option)

2010-07-18 Thread David Christensen
On Jul 18, 2010, at 12:33 PM, David Christensen wrote: > > On Jul 18, 2010, at 12:30 PM, Tom Lane wrote: > >> David Christensen writes: >>> machack:machack:5432=# \c "foo""bar" >>> You are now connected to database "foo"bar". >> >> What this is reflecting is that backslash commands have their