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

[PATCH] Formatting patch for psql

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: pgsql-patches(at)postgresql(dot)org
Subject: [PATCH] Formatting patch for psql
Date: 2005-11-17 13:49:00
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-patches

Here is my patch to make psql handle multi-line output sanely. Instead
of embedded newlines splattering your output across the screen,
everything gets indented to the right column.

It basically works by extending the *_width functions to instead work
out the estimate width, height and formatting space of each cell. Then
the output goes through each cell formatting as it goes and outputting
lines at the right places.

I imagine it will be tweaked by others because everybody has different
ideas about how they want the output done. This just has the minimum
extra formatting to make the output unambiguous.

Also available at:

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.


pgsql-patches by date

Next:From: Andrew DunstanDate: 2005-11-17 14:04:42
Subject: Re: drop if exists
Previous:From: Andreas PflugDate: 2005-11-17 09:57:01
Subject: Re: Numeric 508 datatype

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