Re: [PATCH 5/6] psql: print_aligned_text uses table formatting

Alvaro Herrera <alvherre@commandprompt.com>

From: Alvaro Herrera <alvherre@commandprompt.com>
To: Roger Leigh <rleigh@debian.org>
Cc: pgsql-hackers@postgresql.org
Date: 2009-08-23T15:47:02Z
Lists: pgsql-hackers
Roger Leigh wrote:
> Convert print_aligned_text, and its helper function, to use
> table formatting in place of hardcoded ASCII characters.

> @@ -841,7 +856,10 @@ print_aligned_text(const printTableContent *cont, const printTextFormat *format,
>  
>  			/* left border */
>  			if (opt_border == 2)
> -				fputs("| ", fout);
> +			{
> +				fputs(format->vrule, fout);
> +				fputc(' ', fout);
> +			}
>  			else if (opt_border == 1)
>  				fputc(' ', fout);

Wouldn't it be better to do a single fprintf call here instead of
fputc + fputs?

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