Re: very long record lines in expanded psql output

2023-05-19 Thread Alvaro Herrera
On 2022-Jul-25, Andrew Dunstan wrote: > Committed. There were a couple of bits missing, which I filled in, and I > changed the behaviour when the option is given without an argument, so > that instead of resetting it the current value is shown, similarly to > how most pset options work. I was tra

Re: \pset xheader_width page as default? (Re: very long record lines in expanded psql output)

2022-08-30 Thread Andrew Dunstan
On 2022-08-30 Tu 10:55, Pavel Stehule wrote: > > > út 30. 8. 2022 v 16:49 odesílatel Pavel Stehule > napsal: > > > > út 30. 8. 2022 v 16:36 odesílatel Christoph Berg > napsal: > > Re: Pavel Stehule > > pspg requires all lines to have the same width. It can do > s

Re: \pset xheader_width page as default? (Re: very long record lines in expanded psql output)

2022-08-30 Thread Pavel Stehule
út 30. 8. 2022 v 16:49 odesílatel Pavel Stehule napsal: > > > út 30. 8. 2022 v 16:36 odesílatel Christoph Berg napsal: > >> Re: Pavel Stehule >> > pspg requires all lines to have the same width. It can do some >> corrections >> > - but it is hard to detect wanted differences or just plain text f

Re: \pset xheader_width page as default? (Re: very long record lines in expanded psql output)

2022-08-30 Thread Pavel Stehule
út 30. 8. 2022 v 16:36 odesílatel Christoph Berg napsal: > Re: Pavel Stehule > > pspg requires all lines to have the same width. It can do some > corrections > > - but it is hard to detect wanted differences or just plain text format. > > > > can be nice to have the first invisible row with some

Re: \pset xheader_width page as default? (Re: very long record lines in expanded psql output)

2022-08-30 Thread Christoph Berg
Re: Pavel Stehule > pspg requires all lines to have the same width. It can do some corrections > - but it is hard to detect wanted differences or just plain text format. > > can be nice to have the first invisible row with some information about > used formatting. pspg does some heuristic but this

Re: \pset xheader_width page as default? (Re: very long record lines in expanded psql output)

2022-08-30 Thread Pavel Stehule
út 30. 8. 2022 v 15:49 odesílatel Christoph Berg napsal: > Re: Andrew Dunstan > > >> + pg_log_error("\\pset: allowed xheader_width values > are full > > >> (default), column, page, or an number specifying exact width."); > > > Committed. There were a couple of bits missing, which I

\pset xheader_width page as default? (Re: very long record lines in expanded psql output)

2022-08-30 Thread Christoph Berg
Re: Andrew Dunstan > >> +   pg_log_error("\\pset: allowed xheader_width values are full > >> (default), column, page, or an number specifying exact width."); > Committed. There were a couple of bits missing, which I filled in, and I > changed the behaviour when the option is given with

Re: very long record lines in expanded psql output

2022-07-25 Thread Andrew Dunstan
On 2021-10-03 Su 16:03, Platon Pronko wrote: >> Hi, >> >> +   pg_log_error("\\pset: allowed xheader_width values >> are full >> (default), column, page, or an number specifying exact width."); >> >>   an number specifying -> a number specifying >> >> Cheers >> > > Fixed, attaching the

Re: very long record lines in expanded psql output

2021-10-03 Thread Platon Pronko
Hi, + pg_log_error("\\pset: allowed xheader_width values are full (default), column, page, or an number specifying exact width."); an number specifying -> a number specifying Cheers Fixed, attaching the updated patch. Thank you! Best regards, Platon Pronkodiff --git a/doc/sr

Re: very long record lines in expanded psql output

2021-10-03 Thread Zhihong Yu
On Sun, Oct 3, 2021 at 5:57 AM Platon Pronko wrote: > On 2021-09-24 14:42, Andrew Dunstan wrote: > > > > On 9/24/21 12:49 AM, Platon Pronko wrote: > >> On 2021-09-23 22:28, Andrew Dunstan wrote: > >>> > >>> 2. It would possibly be better to pass the relevant parts of the > options > >>> to print_

Re: very long record lines in expanded psql output

2021-10-03 Thread Platon Pronko
On 2021-09-24 14:42, Andrew Dunstan wrote: On 9/24/21 12:49 AM, Platon Pronko wrote: On 2021-09-23 22:28, Andrew Dunstan wrote: 2. It would possibly be better to pass the relevant parts of the options to print_aligned_vertical_line() rather than the whole options structure. It feels odd to pa

Re: very long record lines in expanded psql output

2021-09-24 Thread Andrew Dunstan
On 9/24/21 12:49 AM, Platon Pronko wrote: > On 2021-09-23 22:28, Andrew Dunstan wrote: >> >> 2. It would possibly be better to pass the relevant parts of the options >> to print_aligned_vertical_line() rather than the whole options >> structure. It feels odd to pass both that and opt_border. > >

Re: very long record lines in expanded psql output

2021-09-23 Thread Platon Pronko
On 2021-09-23 22:28, Andrew Dunstan wrote: 2. It would possibly be better to pass the relevant parts of the options to print_aligned_vertical_line() rather than the whole options structure. It feels odd to pass both that and opt_border. What do you think about doing it the other way around - p

Re: very long record lines in expanded psql output

2021-09-23 Thread Andrew Dunstan
On 8/23/21 2:00 PM, Platon Pronko wrote: > Hi! > > Apparently I did forget something, and that's the patch itself :) > Thanks for Justin Pryzby for pointing this out. > > Attaching the patch now. > > (Please avoid top-posting on PostgreSQL lists) This patch seems basically sound. A couple of t

Re: very long record lines in expanded psql output

2021-08-23 Thread Platon Pronko
Hi! Done, here's the link: https://commitfest.postgresql.org/34/3295/ Best regards, Platon Pronko On 2021-08-23 21:14, Andrew Dunstan wrote: On 8/23/21 2:00 PM, Platon Pronko wrote: Hi! Apparently I did forget something, and that's the patch itself :) Thanks for Justin Pryzby for pointing t

Re: very long record lines in expanded psql output

2021-08-23 Thread Andrew Dunstan
On 8/23/21 2:00 PM, Platon Pronko wrote: > Hi! > > Apparently I did forget something, and that's the patch itself :) > Thanks for Justin Pryzby for pointing this out. > > Attaching the patch now. > > Please add it to the commitfest, the next one starts in about a week. cheers andrew -- Andr

Re: very long record lines in expanded psql output

2021-08-23 Thread Platon Pronko
Hi! Apparently I did forget something, and that's the patch itself :) Thanks for Justin Pryzby for pointing this out. Attaching the patch now. Best regards, Platon Pronko On 2021-08-23 20:51, Platon Pronko wrote: Hi! Please find attached the patch implementing the proposed changes. I hope I

Re: very long record lines in expanded psql output

2021-08-23 Thread Platon Pronko
Hi! Please find attached the patch implementing the proposed changes. I hope I didn't forget anything (docs, tab completion, comments, etc), if I did forget something please tell me and I'll fix it. Best regards, Platon Pronko On 2021-08-08 01:18, Andrew Dunstan wrote: On 8/7/21 10:56 AM, Pla

Re: very long record lines in expanded psql output

2021-08-08 Thread Pavel Stehule
čt 5. 8. 2021 v 17:13 odesílatel Pavel Stehule napsal: > > > čt 5. 8. 2021 v 16:50 odesílatel Platon Pronko > napsal: > >> Hi! >> >> > pspg supports copy cell to clipboard - you can copy complete cell >> > >> > but I am not sure if it is working well in extended mode. This mode is >> not >> > ex

Re: very long record lines in expanded psql output

2021-08-07 Thread Andrew Dunstan
On 8/7/21 10:56 AM, Platon Pronko wrote: > Hi! > >> I also find this annoying and would be happy to be rid of it. > > Have you tried "\pset format wrapped"? Pavel suggested it, and it > solved most of the problem for me, for example. Yes, but it changes the data line out

Re: very long record lines in expanded psql output

2021-08-07 Thread Platon Pronko
Hi! I also find this annoying and would be happy to be rid of it. Have you tried "\pset format wrapped"? Pavel suggested it, and it solved most of the problem for me, for example. Yes, but it changes the data line output. Ideally, you should be able to  modify these independently. I agree,

Re: very long record lines in expanded psql output

2021-08-05 Thread Andrew Dunstan
On 8/5/21 12:48 PM, Platon Pronko wrote: > Hi! I also find this annoying and would be happy to be rid of it. >>> >>> Have you tried "\pset format wrapped"? Pavel suggested it, and it >>> solved most of the problem for me, for example. >> >> Yes, but it changes the data line output. Ideally,

Re: very long record lines in expanded psql output

2021-08-05 Thread Andrew Dunstan
On 8/5/21 2:25 PM, Pavel Stehule wrote: > > > čt 5. 8. 2021 v 18:48 odesílatel Platon Pronko > mailto:platon7pro...@gmail.com>> napsal: > > Hi! > >>> I also find this annoying and would be happy to be rid of it. > >> > >> Have you tried "\pset format wrapped"? Pavel suggested it,

Re: very long record lines in expanded psql output

2021-08-05 Thread Daniel Verite
Platon Pronko wrote: > Maybe we can avoid making the header line longer than terminal width > for \pset border 0 and \pset border 1? We already have terminal > width calculated. Please see attached a patch with the proposed > implementation. +1 for doing something against these long lines

Re: very long record lines in expanded psql output

2021-08-05 Thread Pavel Stehule
čt 5. 8. 2021 v 20:56 odesílatel Platon Pronko napsal: > > it can be a fully new format - designed for simple copy from terminal. > Some > > like > > > > == record: 10 == > > proname > > left > > prosrc > > $lalalal > > ewqrwqerw > > ew

Re: very long record lines in expanded psql output

2021-08-05 Thread Platon Pronko
it can be a fully new format - designed for simple copy from terminal. Some like == record: 10 == proname left prosrc $lalalal ewqrwqerw ewqrwqerqrewq $ === no, it was proposed for psql How is this better than "copy (..

Re: very long record lines in expanded psql output

2021-08-05 Thread Pavel Stehule
čt 5. 8. 2021 v 20:48 odesílatel Platon Pronko napsal: > Hi! > > >> I don't think that would be a good idea. If somebody really just needs > to > >> copy, > >> then wrapping the query in "copy (...) to stdout" already works nicely, > >> no need to create a special mode just for that. > >> > > > >

Re: very long record lines in expanded psql output

2021-08-05 Thread Platon Pronko
Hi! I don't think that would be a good idea. If somebody really just needs to copy, then wrapping the query in "copy (...) to stdout" already works nicely, no need to create a special mode just for that. It is working well, but it is copy to file, not copy to clipboard. Maybe I misunderstoo

Re: very long record lines in expanded psql output

2021-08-05 Thread Pavel Stehule
čt 5. 8. 2021 v 20:30 odesílatel Platon Pronko napsal: > Hi! > > > I also find this annoying and would be happy to be rid of it. > > Have you tried "\pset format wrapped"? Pavel suggested it, and it > solved most of the problem for me, for example. > >>> > >>> Yes, but it chang

Re: very long record lines in expanded psql output

2021-08-05 Thread Platon Pronko
Hi! I also find this annoying and would be happy to be rid of it. Have you tried "\pset format wrapped"? Pavel suggested it, and it solved most of the problem for me, for example. Yes, but it changes the data line output. Ideally, you should be able to modify these independently. I agree,

Re: very long record lines in expanded psql output

2021-08-05 Thread Pavel Stehule
čt 5. 8. 2021 v 18:48 odesílatel Platon Pronko napsal: > Hi! > >>> I also find this annoying and would be happy to be rid of it. > >> > >> Have you tried "\pset format wrapped"? Pavel suggested it, and it > >> solved most of the problem for me, for example. > > > > Yes, but it changes the data li

Re: very long record lines in expanded psql output

2021-08-05 Thread Platon Pronko
Hi! I also find this annoying and would be happy to be rid of it. Have you tried "\pset format wrapped"? Pavel suggested it, and it solved most of the problem for me, for example. Yes, but it changes the data line output. Ideally, you should be able to  modify these independently. I agree,

Re: very long record lines in expanded psql output

2021-08-05 Thread Andrew Dunstan
On 8/5/21 12:04 PM, Platon Pronko wrote: > Hi! > >> I also find this annoying and would be happy to be rid of it. > > Have you tried "\pset format wrapped"? Pavel suggested it, and it > solved most of the problem for me, for example. Yes, but it changes the data line output. Ideally, you should

Re: very long record lines in expanded psql output

2021-08-05 Thread Platon Pronko
Hi! I also find this annoying and would be happy to be rid of it. Have you tried "\pset format wrapped"? Pavel suggested it, and it solved most of the problem for me, for example. Best regards, Platon Pronko

Re: very long record lines in expanded psql output

2021-08-05 Thread Andrew Dunstan
On 8/5/21 6:56 AM, Pavel Stehule wrote: > Hi > > čt 5. 8. 2021 v 12:36 odesílatel Platon Pronko > mailto:platon7pro...@gmail.com>> napsal: > > In expanded mode psql calculates the width of the longest field in > all the output rows, > and prints the header line according to it. This o

Re: very long record lines in expanded psql output

2021-08-05 Thread Pavel Stehule
čt 5. 8. 2021 v 16:50 odesílatel Platon Pronko napsal: > Hi! > > > pspg supports copy cell to clipboard - you can copy complete cell > > > > but I am not sure if it is working well in extended mode. This mode is > not > > extra tested in pspg > > Thanks for the tip! > > I tried it out, in non-ext

Re: very long record lines in expanded psql output

2021-08-05 Thread Pavel Stehule
čt 5. 8. 2021 v 16:32 odesílatel Platon Pronko napsal: > Hi! > > My apologies - I was using pspg incorrectly. If it's called via the pipe > then all the column wrapping is ignored, and that's why I couldn't > reproduce > the issues. If instead pspg is used via "\setenv PAGER pspg", then I > indee

Re: very long record lines in expanded psql output

2021-08-05 Thread Pavel Stehule
čt 5. 8. 2021 v 15:30 odesílatel Platon Pronko napsal: > Hi! > > > a) with line cursor > > Tried in different configurations, seems that line cursor works fine. > > > b) format detection - I try to detect the header line - and I expect this > > line has the most length of all lines. I use a line

Re: very long record lines in expanded psql output

2021-08-05 Thread Pavel Stehule
čt 5. 8. 2021 v 13:14 odesílatel Platon Pronko napsal: > Hi! > > pspg looks nice :) > > > Your proposal breaks pspg > > > > https://github.com/okbob/pspg > > I tried the following (after the patch): > > ./psql template1 -c "select n, repeat('x', n) as long_column_name from > unnest(array[42,210])

Re: very long record lines in expanded psql output

2021-08-05 Thread Pavel Stehule
Hi čt 5. 8. 2021 v 12:36 odesílatel Platon Pronko napsal: > In expanded mode psql calculates the width of the longest field in all the > output rows, > and prints the header line according to it. This often results in record > header wrapping > over several lines (see example below). > > This hu

very long record lines in expanded psql output

2021-08-05 Thread Platon Pronko
In expanded mode psql calculates the width of the longest field in all the output rows, and prints the header line according to it. This often results in record header wrapping over several lines (see example below). This huge record header is printed the same way before each record, even if al