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 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 mailing list (pgsql-

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 : > On Tue, Apr 29, 2014 at 12:37 PM, Sergey Muraviov > wrote: > > 2014-04-29 5:52 GMT+04:00 Peter Eisentraut : > > > >> Please fix this compiler warning. I think it came from this patch. > >> print.c: In function 'print_aligned_vertical': > >>

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 wrote: > 2014-04-29 5:52 GMT+04:00 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 >>

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: note

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

2014-04-26 Thread Tom Lane
Greg Stark 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 run in some o

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 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 alternate output

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 wel

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 : > 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

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 t

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 : > 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

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 new

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 : > 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

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 : > 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 "wra

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-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 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) 201

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 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 the formatting code

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 do

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 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 I was halfway in

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 : > 2014-02-16 18:37, Sergey Muraviov : > > > 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

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

2014-02-17 Thread Emre Hasegeli
2014-02-16 18:37, Sergey Muraviov : > 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". fix_psql_print_aligned_vertical_v5.pat

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 : > 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 : > > It works in expanded mode when either f

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 : > It works in expanded mode when either format option is set to wrapped > (\pset format wrapped), or we have no pager, or pager

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

2013-12-24 Thread Sergey Muraviov
fixed 2013/12/24 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 wh

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 lis

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

2013-12-18 Thread Sergey Muraviov
Hello 2013/12/18 Sameer Thakur > On Wed, Dec 11, 2013 at 11:13 PM, Sergey Muraviov > 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 > (s

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 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 trick). > Target output wi

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 environm

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 'print_a

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 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: http://www.enterprisedb.com The Enterpri

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'); postgre

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 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 fi

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 Ste

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 > Hi. > > Psql definitely have a problem with displaying "wide" tables. > Even in expanded mode, they look horrible. > So I tried to solve

[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 pg_sta