Re: [NOVICE] encoding problems - Mailing list pgsql-patches

From Bruce Momjian
Subject Re: [NOVICE] encoding problems
Date
Msg-id 200805071720.m47HK5U02702@momjian.us
Whole thread Raw
In response to Re: [NOVICE] encoding problems  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [NOVICE] encoding problems
List pgsql-patches
Tom Lane wrote:
> Bruce Momjian <bruce@momjian.us> writes:
> > I have implemented the following patch which outputs tab as a tab.  It
> > also assumes a tab has a width of 4, which is its average width:
>
> That pretty much completely sucks; it will undo all the hard work we've
> put into nice formatting of the output, because seven times out of eight
> this assumption is wrong.
>
> An actually acceptable solution would involve emitting the correct
> number of spaces depending on how much we've put out so far.

Even if we knew the column position at output time, when we are doing
aligned column width computations, we don't know the width of the
previous columns so we would have no way to know how far the tab would
extend in the current column.

The only other idea I have is to output four spaces rather than '\x09'
for a tab.

--
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +

pgsql-patches by date:

Previous
From: Tom Lane
Date:
Subject: Re: [NOVICE] encoding problems
Next
From: Alvaro Herrera
Date:
Subject: Re: [NOVICE] encoding problems