Skip site navigation (1) Skip section navigation (2)

Re: [HACKERS] Spaces in psql output (Was: FW: PGBuildfarm member snake Branch HEAD Status changed)

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: [HACKERS] Spaces in psql output (Was: FW: PGBuildfarm member snake Branch HEAD Status changed)
Date: 2006-02-11 23:26:55
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackerspgsql-patches
On Fri, Feb 10, 2006 at 03:21:47PM -0500, Tom Lane wrote:
> I think it would be a good idea to expect this patch to cause zero
> change in psql output except in the cases where there are actually
> control characters in the data.  Otherwise there are likely to be
> complaints.  (I'm already unhappy at the prospect that this means
> every single regression test's output has changed, even if diff
> --ignore-space is hiding them.)
> I'd settle for stripping trailing blanks on the last line of a multiline
> field value, if that'd be any easier than stripping them for all lines.

Well, the attached patch removes the padding on the last column,
irrespective of the line. It will pad all the way to the end if the
cell is empty due to one of the earlier columns being multiline.

I did it this way because it's not always straight forward to know when
you're on the last line. In any case, this should bring all the
regression output back to the way it was. I didn't realise the
regression diffs ignored spaces...

As to the way the code is done, I prefer seperating out the test into a
variable because fitting it all on a single line is messy. OTOH, some
people discourage the use of ?: but I prefer it to a whole if

Have a nice day,
Martijn van Oosterhout   <kleptog(at)svana(dot)org>
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

In response to


pgsql-hackers by date

Next:From: Mark DilgerDate: 2006-02-12 00:13:44
Subject: Re: Getting the length of varlength data using PG_DETOAST_DATUM_SLICE
Previous:From: Kenneth MarshallDate: 2006-02-11 22:50:48
Subject: Re: SpeedComparison

pgsql-patches by date

Next:From: Tom LaneDate: 2006-02-11 23:36:51
Subject: Re: Skipping VACUUM of indexes when no work required
Previous:From: Bruce MomjianDate: 2006-02-11 22:17:30
Subject: Re: TODO-Item: Rename of constraints

Privacy Policy | About PostgreSQL
Copyright © 1996-2018 The PostgreSQL Global Development Group