Re: Proposed patch - psql wraps at window width - Mailing list pgsql-patches

From Alvaro Herrera
Subject Re: Proposed patch - psql wraps at window width
Date
Msg-id 20080421155925.GS6520@alvh.no-ip.org
Whole thread Raw
In response to Re: Proposed patch - psql wraps at window width  (Bruce Momjian <bruce@momjian.us>)
Responses Re: Proposed patch - psql wraps at window width
Re: Proposed patch - psql wraps at window width
List pgsql-patches
Bruce Momjian wrote:

> !                     /* print a divider, middle columns only */
> !                     if ((j + 1) % col_count)
>                       {
> !                         if (opt_border == 0)
> !                             fputc(' ', fout);
> !                         /* first line for values? */
> !                         else if (line_count == 0 && col_line_count == 0)
> !                             fputs(" | ", fout);
> !                         /* next value is beyond height? */
> !                         else if (line_count >= heights[j + 1])
> !                             fputs("   ", fout);
> !                         /* start of another newline string? */
> !                         else if (col_line_count == 0)
> !                             fputs(" : ", fout);
> !                         else
> !                         {
> !                             /* Does the next column wrap to this line? */
> !                             struct lineptr *this_line = &col_lineptrs[j+1][line_count];
> !                             bool    string_done = *(this_line->ptr + bytes_output[j+1]) == 0;
> !
> !                             fputs(string_done ? "   " : " ; ", fout);
> !                         }
>                       }

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.

--
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

pgsql-patches by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: float4/float8/int64 passed by value with tsearchfixup
Next
From: Bruce Momjian
Date:
Subject: Re: Proposed patch - psql wraps at window width