Re: trailing whitespace in psql table output

Peter Eisentraut <peter_e@gmx.net>

From: Peter Eisentraut <peter_e@gmx.net>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Robert Haas <robertmhaas@gmail.com>, David Fetter <david@fetter.org>, Alvaro Herrera <alvherre@commandprompt.com>, "David E. Wheeler" <david@kineticode.com>, Roger Leigh <rleigh@codelibre.net>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2010-09-28T17:31:17Z
Lists: pgsql-hackers
On tis, 2010-09-28 at 12:18 -0400, Tom Lane wrote:
> I'm inclined to think that that's not a fatal objection; it's not like
> we haven't felt free to change psql's output format before.  As long as
> we don't back-patch this change, it should be no worse than other things
> we've done to third-party code without a backwards glance.

In the past, pg_regress used diff -b or -w, so making whitespace changes
in psql was not a problem.

> It would be good to get rid of this whitespace because (I believe) it is
> one of very few reasons for needing to have any trailing whitespace in
> git-controlled files.  If we could get to a point where trailing
> whitespace in patches could be rejected automatically, it'd eliminate
> one small pet peeve.

You won't be able to programmatically forbid all trailing whitespace (at
least without additional arrangements) because of:

psql -c 'select 1 as a, null as b' | cat -A
 a | b$
---+---$
 1 | $<===

Plus, there might be tests that check trailing space behavior or some
such, but I haven't looked for those.