Re: [HACKERS] psql wrapped format default for backslash-d commands

2008-06-30 Thread Bruce Momjian
Bryce Nesbitt wrote: Brendan Jurd wrote: I really like the idea of wrapping, but after playing with the format a bit myself, I have to agree with Tom that breaking in the middle of words produces some very nasty output. If the format could be improved to only wrap on word boudaries,

Re: [HACKERS] psql wrapped format default for backslash-d commands

2008-06-30 Thread Bruce Momjian
Bruce Momjian wrote: Also, about the format 'auto' idea that uses expanded display, I am thinking because expanded is a separate setting and not a format, I should just add a possible 'auto' value to the expanded format that could be triggered by either 'aligned' or 'wrapped' formats when the

Re: [HACKERS] psql wrapped format default for backslash-d commands

2008-05-13 Thread Bryce Nesbitt
Tom Lane wrote: Bruce Momjian [EMAIL PROTECTED] writes: Now that psql '\pset format wrapped' is in CVS, we should consider when we want to use 'wrapped' format by default. After experimenting for a bit, I'd say "never". This output format is extremely ugly. Maybe if

Re: [HACKERS] psql wrapped format default for backslash-d commands

2008-05-13 Thread Brendan Jurd
On Tue, May 13, 2008 at 4:12 PM, Bryce Nesbitt [EMAIL PROTECTED] wrote: Tom Lane wrote: After experimenting for a bit, I'd say never. This output format is extremely ugly. Maybe if it had enough smarts not to break in the middle of words ... regards, tom lane Yet, wrapped is the same

Re: [HACKERS] psql wrapped format default for backslash-d commands

2008-05-13 Thread Bryce Nesbitt
Brendan Jurd wrote: I really like the idea of wrapping, but after playing with the format a bit myself, I have to agree with Tom that breaking in the middle of words produces some very nasty output. If the format could be improved to only wrap on word boudaries, that would increase its appeal

Re: [HACKERS] psql wrapped format default for backslash-d commands

2008-05-13 Thread Bruce Momjian
Bryce Nesbitt wrote: It's not that hard to do. I chose not to, when writing the patch, because it makes the result flow over many more lines. And regardless, it pretty much has to cut long words, of which there are many in typical SQL output. And, I hardly ever read actual large blocks

Re: [HACKERS] psql wrapped format default for backslash-d commands

2008-05-13 Thread Alvaro Herrera
Bruce Momjian wrote: I think we can wrap if there is whitespace within a few characters before the break point, and use a dash if we have to break a word. Is that what people want? Ugh. -- Alvaro Herrerahttp://www.CommandPrompt.com/ PostgreSQL Replication,

Re: [HACKERS] psql wrapped format default for backslash-d commands

2008-05-13 Thread Tom Lane
Alvaro Herrera [EMAIL PROTECTED] writes: Bruce Momjian wrote: I think we can wrap if there is whitespace within a few characters before the break point, and use a dash if we have to break a word. Is that what people want? Ugh. Inserting dashes would be a truly horrid idea: ab and a-b mean

Re: [HACKERS] psql wrapped format default for backslash-d commands

2008-05-13 Thread Bruce Momjian
Tom Lane wrote: Alvaro Herrera [EMAIL PROTECTED] writes: Bruce Momjian wrote: I think we can wrap if there is whitespace within a few characters before the break point, and use a dash if we have to break a word. Is that what people want? Ugh. Inserting dashes would be a truly

Re: [HACKERS] psql wrapped format default for backslash-d commands

2008-05-13 Thread Alvaro Herrera
Bruce Momjian wrote: The idea would be for the dash to appear outside where normal data appears: internal | RI_FKey_cas-| referential ; cade_del; integrity If we don't allow a dash, I think wrapping on word boundaries will be impossible because we can't

Re: [HACKERS] psql wrapped format default for backslash-d commands

2008-05-13 Thread Tom Lane
Alvaro Herrera [EMAIL PROTECTED] writes: I think the behaviour would be better if we were able to only break on words, and make columns wider on those where words wouldn't fit. select repeat('xyzzy', 10); Now admittedly our current handling of this isn't all that great either, but you

Re: [HACKERS] psql wrapped format default for backslash-d commands

2008-05-13 Thread Bruce Momjian
Alvaro Herrera wrote: Bruce Momjian wrote: The idea would be for the dash to appear outside where normal data appears: internal | RI_FKey_cas-| referential ; cade_del; integrity If we don't allow a dash, I think wrapping on word boundaries will be

Re: [HACKERS] psql wrapped format default for backslash-d commands

2008-05-13 Thread Alvaro Herrera
There's another serious usability problem here, which is that the pager ability is not being used correctly. Consider the \df+ tg_* query I used as example for another bug report. psql says that it is 27 rows; I have my window taller than that (47 lines right now), yet the output is actually *a

Re: [HACKERS] psql wrapped format default for backslash-d commands

2008-05-13 Thread Bruce Momjian
Alvaro Herrera wrote: There's another serious usability problem here, which is that the pager ability is not being used correctly. Consider the \df+ tg_* query I used as example for another bug report. psql says that it is 27 rows; I have my window taller than that (47 lines right now), yet

[HACKERS] psql wrapped format default for backslash-d commands

2008-05-09 Thread Bruce Momjian
Now that psql '\pset format wrapped' is in CVS, we should consider when we want to use 'wrapped' format by default. I think psql \df and \dT certainly can benefit from wrapped mode. \df+ even displays, though there is quite a bit of wrapping. The attached patch uses wrapped format for \d*

Re: [HACKERS] psql wrapped format default for backslash-d commands

2008-05-09 Thread Brendan Jurd
On Sat, May 10, 2008 at 3:52 AM, Bruce Momjian [EMAIL PROTECTED] wrote: Now that psql '\pset format wrapped' is in CVS, we should consider when we want to use 'wrapped' format by default. I think psql \df and \dT certainly can benefit from wrapped mode. \df+ even displays, though there is

Re: [HACKERS] psql wrapped format default for backslash-d commands

2008-05-09 Thread Alvaro Herrera
Brendan Jurd escribió: On Sat, May 10, 2008 at 3:52 AM, Bruce Momjian [EMAIL PROTECTED] wrote: Now that psql '\pset format wrapped' is in CVS, we should consider when we want to use 'wrapped' format by default. I think psql \df and \dT certainly can benefit from wrapped mode. \df+ even

Re: [HACKERS] psql wrapped format default for backslash-d commands

2008-05-09 Thread Brendan Jurd
On Sat, May 10, 2008 at 4:37 AM, Alvaro Herrera [EMAIL PROTECTED] wrote: Brendan Jurd escribió: I for one would definitely like backslash commands with very wide output to be wrapped by default. (At least) one place where I would not like it is in \df+, because wrapped function output would

Re: [HACKERS] psql wrapped format default for backslash-d commands

2008-05-09 Thread Aidan Van Dyk
* Brendan Jurd [EMAIL PROTECTED] [080509 14:43]: On Sat, May 10, 2008 at 4:37 AM, Alvaro Herrera [EMAIL PROTECTED] wrote: Brendan Jurd escribió: I for one would definitely like backslash commands with very wide output to be wrapped by default. (At least) one place where I would not

Re: [HACKERS] psql wrapped format default for backslash-d commands

2008-05-09 Thread Bruce Momjian
Brendan Jurd wrote: [ email paragraphs reordered.] I seem to recall there was some discussion of an auto mode in the original wrapping thread, but if there was any meaningful conclusion I lost it in amongst the width detection flame war. I wasn't going to bring up the 'auto' idea yet because

Re: [HACKERS] psql wrapped format default for backslash-d commands

2008-05-09 Thread Kevin Grittner
Brendan Jurd [EMAIL PROTECTED] wrote: On Sat, May 10, 2008 at 3:52 AM, Bruce Momjian [EMAIL PROTECTED] wrote: Now that psql '\pset format wrapped' is in CVS, we should consider when we want to use 'wrapped' format by default. I think psql \df and \dT certainly can benefit from wrapped mode.

Re: [HACKERS] psql wrapped format default for backslash-d commands

2008-05-09 Thread Bruce Momjian
Brendan Jurd wrote: On Sat, May 10, 2008 at 4:37 AM, Alvaro Herrera [EMAIL PROTECTED] wrote: Brendan Jurd escribi?: I for one would definitely like backslash commands with very wide output to be wrapped by default. (At least) one place where I would not like it is in \df+, because

Re: [HACKERS] psql wrapped format default for backslash-d commands

2008-05-09 Thread Bruce Momjian
Aidan Van Dyk wrote: -- Start of PGP signed section. * Brendan Jurd [EMAIL PROTECTED] [080509 14:43]: On Sat, May 10, 2008 at 4:37 AM, Alvaro Herrera [EMAIL PROTECTED] wrote: Brendan Jurd escribi?: I for one would definitely like backslash commands with very wide output to be wrapped

Re: [HACKERS] psql wrapped format default for backslash-d commands

2008-05-09 Thread Bruce Momjian
Kevin Grittner wrote: Brendan Jurd [EMAIL PROTECTED] wrote: On Sat, May 10, 2008 at 3:52 AM, Bruce Momjian [EMAIL PROTECTED] wrote: Now that psql '\pset format wrapped' is in CVS, we should consider when we want to use 'wrapped' format by default. I think psql \df and \dT certainly

Re: [HACKERS] psql wrapped format default for backslash-d commands

2008-05-09 Thread Alvaro Herrera
Bruce Momjian escribió: Of course, running it on a 50-column display in 'aligned' mode isn't going to look good either. This is what I get by pasting from a 50-column aligned psql (8.3): QUERY PLAN

Re: [HACKERS] psql wrapped format default for backslash-d commands

2008-05-09 Thread Kevin Grittner
Alvaro Herrera [EMAIL PROTECTED] wrote: Bruce Momjian escribió: My conclusion is that we have to make very sure that wrapped is not the default for explain. This will cause me similar pain in other areas. I'm glad I thought of an example with which others could easily identify. -Kevin

Re: [HACKERS] psql wrapped format default for backslash-d commands

2008-05-09 Thread Tom Lane
Bruce Momjian [EMAIL PROTECTED] writes: Now that psql '\pset format wrapped' is in CVS, we should consider when we want to use 'wrapped' format by default. After experimenting for a bit, I'd say never. This output format is extremely ugly. Maybe if it had enough smarts not to break in the