Re: [HACKERS] Patch: psql \whoami option

2010-07-18 Thread Steve Singer
On Sun, 18 Jul 2010, David Christensen wrote: It's helpful when you attach said patch. This has been rebased to current HEAD. One minor thing I noticed in the updated patch. You moved the '{' after the if(host) in command.c to it's own line(good) but you used spaces instead of tabstops th

Re: [HACKERS] Patch: psql \whoami option

2010-07-18 Thread David Christensen
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 own weird > rules for processing double quotes. What I was concern

Re: [HACKERS] Patch: psql \whoami option

2010-07-18 Thread Tom Lane
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 own weird rules for processing double quotes. What I was concerned about was that double quotes in SQL are normally used f

Re: [HACKERS] Patch: psql \whoami option

2010-07-18 Thread David Christensen
On Jul 18, 2010, at 12:17 PM, David Christensen wrote: > > On Jun 21, 2010, at 9:00 AM, Tom Lane wrote: > >> Robert Haas writes: >>> On Sun, Jun 20, 2010 at 10:51 PM, Steve Singer >>> wrote: One comment I have on the output format is that values (ie the database name) are enclosed

Re: [HACKERS] Patch: psql \whoami option

2010-07-18 Thread David Christensen
On Jun 21, 2010, at 9:00 AM, Tom Lane wrote: > Robert Haas writes: >> On Sun, Jun 20, 2010 at 10:51 PM, Steve Singer >> wrote: >>> One comment I have on the output format is that values (ie the database >>> name) are enclosed in double quotes but the values being quoted can contain >>> double

Re: [HACKERS] Patch: psql \whoami option

2010-06-21 Thread Tom Lane
Robert Haas writes: > Is there really a point to the non-DSN format or should we just use > the DSN format always? BTW, didn't have an opinion on that to start with, but after thinking about it I'd turn it around. psql doesn't deal in DSN format anywhere else, so why should it do so here? To ma

Re: [HACKERS] Patch: psql \whoami option

2010-06-21 Thread Tom Lane
Robert Haas writes: > On Sun, Jun 20, 2010 at 10:51 PM, Steve Singer > wrote: >> One comment I have on the output format is that values (ie the database >> name) are enclosed in double quotes but the values being quoted can contain >> double quotes that are not being escaped. This is the same a

Re: [HACKERS] Patch: psql \whoami option

2010-06-20 Thread Robert Haas
On Sun, Jun 20, 2010 at 10:51 PM, Steve Singer wrote: > One comment I have on the output format is that values (ie the database > name) are enclosed in double quotes but the values being quoted can contain > double quotes that are not being escaped.   For example > > Connected to database: "testin

Re: [HACKERS] Patch: psql \whoami option

2010-06-20 Thread Steve Singer
This is a review for the \whoami patch (changed to \conninfo). This review was done on the Feb 2 2010 version of the patch (rebased to head) that reflects some of the feedback from -hackers on the initial submission. The commitfest entry should be updated to reflect the most recent version

Re: [HACKERS] Patch: psql \whoami option

2010-02-05 Thread Bruce Momjian
I have added this patch to the next commit-fest. Thanks: https://commitfest.postgresql.org/action/commitfest_view?id=6 --- David Christensen wrote: > -hackers, > > In the spirit of small, but hopefully useful inte

Re: [HACKERS] Patch: psql \whoami option

2010-01-27 Thread Tom Lane
Magnus Hagander writes: > 2010/1/27 Martin Atukunda : >> How about using the psql prompt to convey this information? > I think the idea is that if you do that, it'll be there all the time, > potentially "crowding the space". I had the same reaction as Martin. If you want this info all the time,

Re: [HACKERS] Patch: psql \whoami option

2010-01-27 Thread Tom Lane
David Christensen writes: > That's a good point about forward-compatibility. In that case, I'm > not sure if "default" is the best name for the human-readable format, > but I didn't like "human-readable" ;-). I assume that should have an > explicit spelling, and not just be the format that

Re: [HACKERS] Patch: psql \whoami option

2010-01-27 Thread David Christensen
On Jan 27, 2010, at 8:08 AM, Magnus Hagander wrote: 2010/1/27 David Christensen : On Jan 27, 2010, at 4:01 AM, Magnus Hagander wrote: 2010/1/27 Josh Berkus : On 1/26/10 3:24 PM, David Christensen wrote: -hackers, In the spirit of small, but hopefully useful interface improvement patche

Re: [HACKERS] Patch: psql \whoami option

2010-01-27 Thread Magnus Hagander
2010/1/27 David Christensen : > > On Jan 27, 2010, at 4:01 AM, Magnus Hagander wrote: > >> 2010/1/27 Josh Berkus : >>> >>> On 1/26/10 3:24 PM, David Christensen wrote: -hackers, In the spirit of small, but hopefully useful interface improvement patches, enclosed for your re

Re: [HACKERS] Patch: psql \whoami option

2010-01-27 Thread David Christensen
On Jan 27, 2010, at 5:23 AM, Martin Atukunda wrote: How about using the psql prompt to convey this information? IIRC the psql prompt can be configured to show the hostname, server, port and other fields. Wouldn't this be enough? or am I missing something? Prompt customization is certainly

Re: [HACKERS] Patch: psql \whoami option

2010-01-27 Thread David Christensen
On Jan 27, 2010, at 4:01 AM, Magnus Hagander wrote: 2010/1/27 Josh Berkus : On 1/26/10 3:24 PM, David Christensen wrote: -hackers, In the spirit of small, but hopefully useful interface improvement patches, enclosed for your review is a patch for providing psql with a \whoami command (may

Re: [HACKERS] Patch: psql \whoami option

2010-01-27 Thread Thom Brown
2010/1/27 Thom Brown > 2010/1/27 Josh Berkus > >> >> however, \conninfo is probably the better name. >> > > +1 > > Something along the lines of: "Connected to localhost port 5432 as user > thomb"? > > Thom > > Er... ignore that. Just saw the other examples which are better ;)

Re: [HACKERS] Patch: psql \whoami option

2010-01-27 Thread Thom Brown
2010/1/27 Josh Berkus > > however, \conninfo is probably the better name. > +1 Something along the lines of: "Connected to localhost port 5432 as user thomb"? Thom

Re: [HACKERS] Patch: psql \whoami option

2010-01-27 Thread Magnus Hagander
I think the idea is that if you do that, it'll be there all the time, potentially "crowding the space". //Magnus 2010/1/27 Martin Atukunda : > How about using the psql prompt to convey this information? IIRC the psql > prompt can be configured to show the hostname, server, port and other fields.

Re: [HACKERS] Patch: psql \whoami option

2010-01-27 Thread Martin Atukunda
How about using the psql prompt to convey this information? IIRC the psql prompt can be configured to show the hostname, server, port and other fields. Wouldn't this be enough? or am I missing something? - Martin - On 27 Jan 2010, at 13:01, Magnus Hagander wrote: 2010/1/27 Josh Berkus : O

Re: [HACKERS] Patch: psql \whoami option

2010-01-27 Thread Magnus Hagander
2010/1/27 Josh Berkus : > On 1/26/10 3:24 PM, David Christensen wrote: >> -hackers, >> >> In the spirit of small, but hopefully useful interface improvement >> patches, enclosed for your review is a patch for providing psql with a >> \whoami command (maybe a better name is \conninfo or similar).  I

Re: [HACKERS] Patch: psql \whoami option

2010-01-26 Thread Josh Berkus
On 1/26/10 3:24 PM, David Christensen wrote: > -hackers, > > In the spirit of small, but hopefully useful interface improvement > patches, enclosed for your review is a patch for providing psql with a > \whoami command (maybe a better name is \conninfo or similar). Its > purpose is to print infor

[HACKERS] Patch: psql \whoami option

2010-01-26 Thread David Christensen
-hackers, In the spirit of small, but hopefully useful interface improvement patches, enclosed for your review is a patch for providing psql with a \whoami command (maybe a better name is \conninfo or similar). Its purpose is to print information about the current connection, by default