Bryce Nesbitt wrote:
The newline handling code was, by far, the most complex part of this
patch. While I think it would be nicer to filter up past the newline,
I just don't see this as a common need. Large text fields with newlines
are difficult to really view in psql anyway, and they are
Bryce Nesbitt wrote:
1) \pset columns XX should make it clear that's for file output only.
OK, docs updated.
2) There's an extra space, which breaks \pset border 2
717c717
fputc(' ', fout);;
---
fputc(' ',
Bruce Momjian wrote:
! /* print a divider, middle columns only
*/
! if ((j + 1) % col_count)
{
! if (opt_border == 0)
!
Alvaro Herrera wrote:
Bruce Momjian wrote:
! /* print a divider, middle columns only
*/
! if ((j + 1) % col_count)
{
! if (opt_border ==
Alvaro Herrera wrote:
Bruce Momjian wrote:
! fputs(string_done ?
: ; , fout);
! }
}
I think it's a bad idea to use the same : separator in the two
Bruce Momjian wrote:
I think it's a bad idea to use the same : separator in the two last
cases. They are different and they should be displayed differently.
I confirmed with Alvaro that he didn't notice the first uses a colon and
the second a semicolon, so he is OK.
FYI, I added a
The newline handling code was, by far, the most complex part of this
patch. While I think it would be nicer to filter up past the newline,
I just don't see this as a common need. Large text fields with newlines
are difficult to really view in psql anyway, and they are likely to be
the
1) \pset columns XX should make it clear that's for file output only.
2) There's an extra space, which breaks \pset border 2
717c717
fputc(' ', fout);;
---
fputc(' ', fout);
842c842
Bryce Nesbitt wrote:
Bruce Momjian wrote:
I don't think you need to do that to get it applied --- there is nothing
windows-specific in your code.
Is this ready to be applied? Do you want to send a final update or are
you still testing?
Looks good, but I suggest adding give up if
Alvaro Herrera wrote:
* Don't lose warning comments like this one (unless you've removed the
assumption of course)
/*
* Assumption: This code used only on strings
* without multibyte characters, otherwise
* this_line-width strlen(this_ptr) and we get
* an overflow
*/
In fact, that
Peter Eisentraut wrote:
Bruce Momjian wrote:
I checked the use of COLUMNS and it seems bash updates the environment
variable when a window is resized. I added ioctl(TIOCGWINSZ) if COLUMNS
isn't set. We already had a call in print.c for detecting the
number of rows on the screen to
Tom Lane [EMAIL PROTECTED] writes:
Bryce Nesbitt [EMAIL PROTECTED] writes:
pre wrap=I checked the use of COLUMNS and it seems bash updates the
environment
variable when a window is resized.
[ Please get rid of the HTML formatting ... ]
Bash can update the environment all it wants,
Peter Eisentraut wrote:
Bruce Momjian wrote:
I checked the use of COLUMNS and it seems bash updates the environment
variable when a window is resized. I added ioctl(TIOCGWINSZ) if COLUMNS
isn't set. We already had a call in print.c for detecting the
number of rows on the screen to
Bryce Nesbitt [EMAIL PROTECTED] writes:
I asked the folks over at Experts Exchange to test the behavior of the ioctl
I always thought that was a joke domain name, like Pen Island.com.
--
Gregory Stark
EnterpriseDB http://www.enterprisedb.com
Ask me about EnterpriseDB's PostGIS
On Fri, 18 Apr 2008 17:21:26 +0100
Gregory Stark [EMAIL PROTECTED] wrote:
Bryce Nesbitt [EMAIL PROTECTED] writes:
I asked the folks over at Experts Exchange to test the behavior
of the ioctl
I always thought that was a joke domain name, like Pen Island.com.
Its not and a lot of
Bruce Momjian wrote:
In testing I found the regression tests were failing because of a divide
by zero error (fixed), and a missing case where the column delimiter has
to be :. In fact I now see all your line continuation cases using :
rather than !. It actually looks better --- ! was too
Bruce Momjian wrote:
I checked the use of COLUMNS and it seems bash updates the environment
variable when a window is resized. I added ioctl(TIOCGWINSZ) if COLUMNS
isn't set. We already had a call in print.c for detecting the
number of rows on the screen to determine if the pager should
be
Bryce Nesbitt wrote:
Bruce Momjian wrote:
I spent time reviewing your patch --- quite impressive. I have attached
and updated version with mostly stylistic changes.
In testing I found the regression tests were failing because of a divide
by zero error (fixed), and a missing case
Bryce Nesbitt wrote:
I've attached a patch, against current 8.4 cvs, which optionally sets a
maximum width for psql output:
Some random comments:
* Don't use C++ style comments (//). Some compilers don't like these.
* Beware of brace position: we use braces on their own, indented at the
Alvaro is correct. I made most or all of these adjustments in the
updated version I posted yesterday.
---
Alvaro Herrera wrote:
Bryce Nesbitt wrote:
I've attached a patch, against current 8.4 cvs, which optionally sets
Bruce Momjian wrote:
Alvaro is correct. I made most or all of these adjustments in the
updated version I posted yesterday.
Doh. I didn't realize you had posted a new version :-(
People is complaining here that we don't teach people here anyway, so
hopefully my comments were still useful
Alvaro Herrera wrote:
Bruce Momjian wrote:
Alvaro is correct. I made most or all of these adjustments in the
updated version I posted yesterday.
Doh. I didn't realize you had posted a new version :-(
People is complaining here that we don't teach people here anyway, so
hopefully
Peter Eisentraut [EMAIL PROTECTED] writes:
Bruce Momjian wrote:
I checked the use of COLUMNS and it seems bash updates the environment
variable when a window is resized. I added ioctl(TIOCGWINSZ) if COLUMNS
isn't set. We already had a call in print.c for detecting the
number of rows on the
Gregory Stark [EMAIL PROTECTED] writes:
Also, how would you suggest figuring the width to use for output going to a
file? ioctl is irrelevant in that case, imho it should just default to 80
columns if COLUMNS is unset.
It would be a spectacularly awful idea for this patch to affect the
output
Tom Lane [EMAIL PROTECTED] writes:
Gregory Stark [EMAIL PROTECTED] writes:
Also, how would you suggest figuring the width to use for output going to a
file? ioctl is irrelevant in that case, imho it should just default to 80
columns if COLUMNS is unset.
It would be a spectacularly awful
It would be a spectacularly awful idea for this patch to affect the
output to a file at all.
.
It sucks to run a program, decide you want to capture that output and find you
get something else. It *really* sucks to find there's just no way to get the
same output short of
Peter Eisentraut wrote:
Bruce Momjian wrote:
I checked the use of COLUMNS and it seems bash updates the environment
variable when a window is resized. I added ioctl(TIOCGWINSZ) if COLUMNS
isn't set. We already had a call in print.c for detecting the
number of rows on the
Bruce Momjian wrote:
I also found that for hugely wide output it was better to give up (do
nothing), rather than mangle the output in a futile attempt to squash it
to the window width. So there is one more clause in the wrapping if.
Was it because of performance? I have
Bryce Nesbitt [EMAIL PROTECTED] writes:
pre wrap=I checked the use of COLUMNS and it seems bash updates the
environment
variable when a window is resized.
[ Please get rid of the HTML formatting ... ]
Bash can update the environment all it wants, but that will not affect
what is seen by
Bryce Nesbitt wrote:
I've attached a patch, against current 8.4 cvs, which optionally sets a
maximum width for psql output:
# \pset format aligned-wrapped
# \pset border 2
# select * from distributors order by did;
+--++-+---+
|
Bruce Momjian wrote:
I spent time reviewing your patch --- quite impressive. I have attached
and updated version with mostly stylistic changes.
In testing I found the regression tests were failing because of a divide
by zero error (fixed), and a missing case where the column delimiter has
to
I've attached a patch, against current 8.4 cvs, which optionally sets a
maximum width for psql output:
# \pset format aligned-wrapped
# \pset border 2
# select * from distributors order by did;
+--++-+---+
| did |name|
32 matches
Mail list logo