Re: [NOVICE] encoding problems

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Cliff Nieuwenhuis <cliff(at)nieusite(dot)com>, PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: [NOVICE] encoding problems
Date: 2008-05-07 17:20:05
Message-ID: 200805071720.m47HK5U02702@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-novice pgsql-patches

Tom Lane wrote:
> Bruce Momjian <bruce(at)momjian(dot)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(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2008-05-07 17:26:52 Commit fest going well
Previous Message Aidan Van Dyk 2008-05-07 16:59:18 Re: Posting to hackers and patches lists

Browse pgsql-novice by date

  From Date Subject
Next Message Alvaro Herrera 2008-05-07 17:37:02 Re: [NOVICE] encoding problems
Previous Message Frank Bax 2008-05-07 16:55:14 Re: Disadvantages to using "text"

Browse pgsql-patches by date

  From Date Subject
Next Message Alvaro Herrera 2008-05-07 17:37:02 Re: [NOVICE] encoding problems
Previous Message Aidan Van Dyk 2008-05-07 16:59:18 Re: Posting to hackers and patches lists