Re: \pset xheader_width page as default? (Re: very long record lines in expanded psql output) - Mailing list pgsql-hackers

From Pavel Stehule
Subject Re: \pset xheader_width page as default? (Re: very long record lines in expanded psql output)
Date
Msg-id CAFj8pRCjmO1dogaDGQzkY6YtFLU+Q0LNcu=7q3-+1w25O3+Jnw@mail.gmail.com
Whole thread Raw
In response to \pset xheader_width page as default? (Re: very long record lines in expanded psql output)  (Christoph Berg <myon@debian.org>)
Responses Re: \pset xheader_width page as default? (Re: very long record lines in expanded psql output)
List pgsql-hackers


út 30. 8. 2022 v 15:49 odesílatel Christoph Berg <myon@debian.org> 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 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.

Thanks for implementing this! This has been #1 on my PG annoyances
list since forever. I had even tried to patch it 10½ years ago, but
ever managed to get that patch to submittable quality.

Now, is there a chance that we could make this the default? Having
psql print a whole screen of ------------ minus characters doesn't
seem very useful as default behavior.

I see upthread that Pavel was objecting to that because pspg doesn't
understand it. But since the expanded format is a one-column output,
and the only thing pspg needs to know is the maxium line length, I'd
think pspg could just look at each line, and update the maximum as it
reads the input anyway.

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 code is not nice and it is fragile.

Regards

Pavel


Can we set 'page' as default?

Christoph


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Convert *GetDatum() and DatumGet*() macros to inline functions
Next
From: Tom Lane
Date:
Subject: Re: Convert *GetDatum() and DatumGet*() macros to inline functions