Re: [HACKERS] Problem with displaying wide tables in psql

2014-04-29 Thread Greg Stark
On Tue, Apr 29, 2014 at 2:52 AM, Peter Eisentraut pete...@gmx.net wrote: Please fix this compiler warning. I think it came from this patch. Oops, I fixed it in a previous version but didn't notice it had crept back in in the back-and-forth. Will do. -- greg -- Sent via pgsql-hackers

Re: [HACKERS] Problem with displaying wide tables in psql

2014-04-28 Thread Peter Eisentraut
Please fix this compiler warning. I think it came from this patch. print.c: In function ‘print_aligned_vertical’: print.c:1354:10: error: pointer targets in passing argument 1 of ‘strlen_max_width’ differ in signedness [-Werror=pointer-sign] encoding); ^ print.c:126:12:

Re: [HACKERS] Problem with displaying wide tables in psql

2014-04-28 Thread Michael Paquier
On Tue, Apr 29, 2014 at 12:37 PM, Sergey Muraviov sergey.k.murav...@gmail.com wrote: 2014-04-29 5:52 GMT+04:00 Peter Eisentraut pete...@gmx.net: Please fix this compiler warning. I think it came from this patch. print.c: In function 'print_aligned_vertical': print.c:1354:10: error: pointer

Re: [HACKERS] Problem with displaying wide tables in psql

2014-04-28 Thread Sergey Muraviov
rebased 2014-04-29 7:43 GMT+04:00 Michael Paquier michael.paqu...@gmail.com: On Tue, Apr 29, 2014 at 12:37 PM, Sergey Muraviov sergey.k.murav...@gmail.com wrote: 2014-04-29 5:52 GMT+04:00 Peter Eisentraut pete...@gmx.net: Please fix this compiler warning. I think it came from this

Re: [HACKERS] Problem with displaying wide tables in psql

2014-04-26 Thread Tom Lane
Greg Stark st...@mit.edu writes: I expect this regression test to fail on platforms that don't support utf-8 client-side (I'm assuming we such things?). I don't have such a platform here and I'm not sure how it would fail so I want to go ahead and apply it and grab the output to add the

Re: [HACKERS] Problem with displaying wide tables in psql

2014-04-26 Thread Greg Stark
Not sure what other encodings you mean. Psql uses utf8 for the border and the test uses utf8 to test the formatting. I was only anticipating an error on platforms where that didn't work. I would lean towards having it but I'm fine following your judgement, especially given the timing. -- greg

Re: [HACKERS] Problem with displaying wide tables in psql

2014-04-26 Thread Tom Lane
Greg Stark st...@mit.edu writes: Not sure what other encodings you mean. Psql uses utf8 for the border and the test uses utf8 to test the formatting. I was only anticipating an error on platforms where that didn't work. Well, there are two likely misbehaviors if the regression test is being

Re: [HACKERS] Problem with displaying wide tables in psql

2014-04-11 Thread Sergey Muraviov
Hi. I've done some corrections for printing newline and wrap indicators. Please review the attached patch. 2014-04-11 0:14 GMT+04:00 Sergey Muraviov sergey.k.murav...@gmail.com: Hi. Thanks for your tests. I've fixed problem with headers, but got new one with data. I'll try to solve it

Re: [HACKERS] Problem with displaying wide tables in psql

2014-04-11 Thread Greg Stark
Looks good. It's still not doing the old-ascii column dividers but to be honest I'm not sure what the intended behaviour of old-ascii is. I've noticed old-ascii only displays the line markers for dividing lines, not the final one. That seems pretty useless and maybe it's why we switched to the

Re: [HACKERS] Problem with displaying wide tables in psql

2014-04-11 Thread Sergey Muraviov
I hope that I realized old-ascii logic correctly. 2014-04-11 19:10 GMT+04:00 Greg Stark st...@mit.edu: Looks good. It's still not doing the old-ascii column dividers but to be honest I'm not sure what the intended behaviour of old-ascii is. I've noticed old-ascii only displays the line

Re: [HACKERS] Problem with displaying wide tables in psql

2014-04-11 Thread Alvaro Herrera
Sergey Muraviov wrote: I hope that I realized old-ascii logic correctly. I don't know what you changed here, but I don't think we need to preserve old-ascii behavior in the new code, in any way. If you're mimicking something obsolete and the end result of the new feature is not great, perhaps

Re: [HACKERS] Problem with displaying wide tables in psql

2014-04-11 Thread Sergey Muraviov
There were no support for wrapping and old-ascii line style in expanded mode at all. But now they are. 2014-04-11 21:58 GMT+04:00 Alvaro Herrera alvhe...@2ndquadrant.com: Sergey Muraviov wrote: I hope that I realized old-ascii logic correctly. I don't know what you changed here, but I

Re: [HACKERS] Problem with displaying wide tables in psql

2014-04-11 Thread Greg Stark
Yeah, I think I agree. I'm pretty happy to commit it without old-ascii doing anything special. It looks to me like old-ascii just isn't very useful for a single column output (like expanded mode is implicitly). Maybe that needs to be fixed but then it needs to be fixed for non expanded mode as

Re: [HACKERS] Problem with displaying wide tables in psql

2014-04-10 Thread Greg Stark
Ok, So I've hacked on this a bit. Below is a test case showing the problems I've found. 1) It isn't using the newline and wrap indicators or dividing lines. 2) The header is not being displayed properly when it contains a newline. I can hack in the newline and wrap indicators but the header

Re: [HACKERS] Problem with displaying wide tables in psql

2014-04-10 Thread Sergey Muraviov
Hi. Thanks for your tests. I've fixed problem with headers, but got new one with data. I'll try to solve it tomorrow. 2014-04-10 18:45 GMT+04:00 Greg Stark st...@mit.edu: Ok, So I've hacked on this a bit. Below is a test case showing the problems I've found. 1) It isn't using the newline

Re: [HACKERS] Problem with displaying wide tables in psql

2014-04-09 Thread Sergey Muraviov
Hi. How can I pass or set the value of pset variable for an regression test? The code with ioctl was copied from print_aligned_text function, which has a long history. 43ee2282 (Bruce Momjian 2008-05-16 16:59:05 + 680) if (ioctl(fileno(stdout), TIOCGWINSZ, screen_size) != -1)

Re: [HACKERS] Problem with displaying wide tables in psql

2014-04-09 Thread Greg Stark
How can I pass or set the value of pset variable for an regression test? I just wrote some tests using \pset columns to control the output. Having figured out what the point of the patch is I'm pretty happy with the functionality. It definitely is something I would appreciate having. One thing

Re: [HACKERS] Problem with displaying wide tables in psql

2014-04-08 Thread Greg Stark
On Sat, Feb 15, 2014 at 11:08 AM, Emre Hasegeli e...@hasegeli.com wrote: This is my review about 3th version of the patch. It is an useful improvement in my opinion. It worked well on my environment. I'm reviewing this patch. One thing to comment: With no doc changes and no regression tests

Re: [HACKERS] Problem with displaying wide tables in psql

2014-04-08 Thread Andres Freund
On 2014-04-08 12:15:47 -0400, Greg Stark wrote: With no doc changes and no regression tests I was halfway inclined to just reject it out of hand. To be fair there were no regression tests for wrapped output prior to the patch but still I would have wanted to see them added. We often pare down

Re: [HACKERS] Problem with displaying wide tables in psql

2014-04-08 Thread Greg Stark
On Tue, Apr 8, 2014 at 12:19 PM, Andres Freund and...@2ndquadrant.com wrote: I don't think this is easily testable that way - doesn't it rely on determining the width of the terminal? Which you won't have when started from pg_regress? There's a pset variable to set the target width so at least

Re: [HACKERS] Problem with displaying wide tables in psql

2014-02-17 Thread Emre Hasegeli
2014-02-16 18:37, Sergey Muraviov sergey.k.murav...@gmail.com: New code doesn't work with empty strings but I've done minor optimization for this case. It seems better now. I added some new lines and spaces, removed unnecessary parentheses and marked it as Ready for Committer.

Re: [HACKERS] Problem with displaying wide tables in psql

2014-02-17 Thread Sergey Muraviov
Thanks. 2014-02-17 12:22 GMT+04:00 Emre Hasegeli e...@hasegeli.com: 2014-02-16 18:37, Sergey Muraviov sergey.k.murav...@gmail.com: New code doesn't work with empty strings but I've done minor optimization for this case. It seems better now. I added some new lines and spaces, removed

Re: [HACKERS] Problem with displaying wide tables in psql

2014-02-16 Thread Sergey Muraviov
Hi. Thanks for your review. 2014-02-15 20:08 GMT+04:00 Emre Hasegeli e...@hasegeli.com: Hi, This is my review about 3th version of the patch. It is an useful improvement in my opinion. It worked well on my environment. 2013-12-11 17:43:06, Sergey Muraviov sergey.k.murav...@gmail.com: It

Re: [HACKERS] Problem with displaying wide tables in psql

2014-02-15 Thread Emre Hasegeli
Hi, This is my review about 3th version of the patch. It is an useful improvement in my opinion. It worked well on my environment. 2013-12-11 17:43:06, Sergey Muraviov sergey.k.murav...@gmail.com: It works in expanded mode when either format option is set to wrapped (\pset format wrapped), or

Re: [HACKERS] Problem with displaying wide tables in psql

2013-12-24 Thread Peter Eisentraut
Please fix this: src/bin/psql/print.c:1269: trailing whitespace. src/bin/psql/print.c:1351: trailing whitespace. src/bin/psql/print.c:1359: trailing whitespace. src/bin/psql/print.c:1364: trailing whitespace. src/bin/psql/print.c:2263: trailing whitespace. -- Sent via pgsql-hackers mailing

Re: [HACKERS] Problem with displaying wide tables in psql

2013-12-24 Thread Sergey Muraviov
fixed 2013/12/24 Peter Eisentraut pete...@gmx.net Please fix this: src/bin/psql/print.c:1269: trailing whitespace. src/bin/psql/print.c:1351: trailing whitespace. src/bin/psql/print.c:1359: trailing whitespace. src/bin/psql/print.c:1364: trailing whitespace. src/bin/psql/print.c:2263:

Re: [HACKERS] Problem with displaying wide tables in psql

2013-12-18 Thread Sergey Muraviov
Hello 2013/12/18 Sameer Thakur samthaku...@gmail.com On Wed, Dec 11, 2013 at 11:13 PM, Sergey Muraviov sergey.k.murav...@gmail.com wrote: Hi. I've improved the patch. It works in expanded mode when either format option is set to wrapped (\pset format wrapped), or we have no pager,

Re: [HACKERS] Problem with displaying wide tables in psql

2013-12-17 Thread Sameer Thakur
On Wed, Dec 11, 2013 at 11:13 PM, Sergey Muraviov sergey.k.murav...@gmail.com wrote: Hi. I've improved the patch. It works in expanded mode when either format option is set to wrapped (\pset format wrapped), or we have no pager, or pager doesn't chop long lines (so you can still use the

Re: [HACKERS] Problem with displaying wide tables in psql

2013-12-11 Thread Sergey Muraviov
Hi. I've improved the patch. It works in expanded mode when either format option is set to wrapped (\pset format wrapped), or we have no pager, or pager doesn't chop long lines (so you can still use the trick). Target output width is taken from either columns option (\pset columns 70), or

Re: [HACKERS] Problem with displaying wide tables in psql

2013-12-09 Thread Jeff Janes
On Mon, Dec 2, 2013 at 10:45 PM, Sergey Muraviov sergey.k.murav...@gmail.com wrote: Hi. Psql definitely have a problem with displaying wide tables. Even in expanded mode, they look horrible. So I tried to solve this problem. I get compiler warnings: print.c: In function

Re: [HACKERS] Problem with displaying wide tables in psql

2013-12-05 Thread Robert Haas
On Thu, Dec 5, 2013 at 1:09 AM, Sergey Muraviov sergey.k.murav...@gmail.com wrote: And my patch affects the row view only. To help us avoid forgetting about this patch, please add it here: https://commitfest.postgresql.org/action/commitfest_view/open -- Robert Haas EnterpriseDB:

Re: [HACKERS] Problem with displaying wide tables in psql

2013-12-04 Thread Alexander Korotkov
On Wed, Dec 4, 2013 at 11:20 AM, Sergey Muraviov sergey.k.murav...@gmail.com wrote: Thank you for this trick. It would be nice if this trick was documented. However, with the pager I can't see wide value on one screen, select and copy it entirely. And I have to press many keys to find the

Re: [HACKERS] Problem with displaying wide tables in psql

2013-12-04 Thread Pavel Stehule
Hello postgres=# \pset format wrapped Output format (format) is wrapped. postgres=# select 'afadsafasd fasdf asdfasd fsad fas df sadf sad f sadf sadf sa df sadfsadfasd fsad fsa df sadf asd fa sfd sadfsadf asdf sad f sadf sad fadsf'; ?column?

Re: [HACKERS] Problem with displaying wide tables in psql

2013-12-04 Thread Sergey Muraviov
And my patch affects the row view only. postgres=# \x 1 postgres=# create table wide_table (value text); postgres=# insert into wide_table values ('afadsafasd fasdf asdfasd fsad fas df sadf sad f sadf sadf sa df sadfsadfasd fsad fsa df sadf asd fa sfd sadfsadf asdf sad f sadf sad fadsf');

[HACKERS] Problem with displaying wide tables in psql

2013-12-03 Thread Sergey Muraviov
Hi. Psql definitely have a problem with displaying wide tables. Even in expanded mode, they look horrible. So I tried to solve this problem. Before the patch: postgres=# \x 1 Expanded display (expanded) is on. postgres=# \pset border 2 Border style (border) is 2. postgres=# select * from

Re: [HACKERS] Problem with displaying wide tables in psql

2013-12-03 Thread Pavel Stehule
Hello do you know a pager less trick http://merlinmoncure.blogspot.cz/2007/10/better-psql-with-less.html Regards Pavel Stehule 2013/12/3 Sergey Muraviov sergey.k.murav...@gmail.com Hi. Psql definitely have a problem with displaying wide tables. Even in expanded mode, they look horrible.

Re: [HACKERS] Problem with displaying wide tables in psql

2013-12-03 Thread Sergey Muraviov
Thank you for this trick. It would be nice if this trick was documented. However, with the pager I can't see wide value on one screen, select and copy it entirely. And I have to press many keys to find the necessary part of the value. There is no such problems with the patch. 2013/12/3 Pavel