[Techtalk] Column display width on postgresql

Meryll Larkin mll at alwanza.com
Wed Jan 20 05:01:41 UTC 2010


Hi Anne,

It might be easier to look for a setting to increase the column width (or
decrease the font size?) of whatever you are using to display the results.  

I don't know how to format the output of a PostgreSQL query so that the
output is less than the column size EXCEPT by running the query through a
script (like a Perl script), receiving the output as a database hashref or
arrayref, running each field through regex to remove trailing spaces, and
then printing.

If you do that, each line will be a different width, depending on output,
and you will probably want to join fields with a delimitor (a pipe or a
comma - depending on which is less likely to be inside your query results).

Maybe someone else will know how to format query results from PostgreSQL
without resorting to using another scripting language....

Meryll Larkin



More information about the Techtalk mailing list