Re: psql word wrapping to terminal width - testers?

From: Bryce Nesbitt <bryce2(at)obviously(dot)com>
To: sql pgsql <pgsql-sql(at)postgresql(dot)org>
Cc: Karsten Hilbert <Karsten(dot)Hilbert(at)gmx(dot)net>
Subject: Re: psql word wrapping to terminal width - testers?
Date: 2008-03-03 19:30:07
Message-ID: 47CC51BF.8050209@obviously.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<br>
<br>
Karsten Hilbert wrote:<br>
<blockquote cite="mid:20080303122202(dot)GA4028(at)merkur(dot)hilbert(dot)loc"
type="cite">
<blockquote type="cite">
<pre wrap=""># \pset format aligned-wrapped
# \pset border 2
# select * from distributors order by did;
+------+--------------------+---------------------+---------------+
| did | name | descr | long_col_name |
+------+--------------------+---------------------+---------------+
| 1 | Food fish and wine | default | |
| 2 | Cat Food Heaven 2 | abcdefghijklmnopqrs ! |
</pre>
</blockquote>
<pre wrap=""><!----> ^
Any chance you could put an indicator here to point out the
field has been wrapped ?
</pre>
</blockquote>
It is there but subtle.  Note the ! instead of |.<br>
<br>
<blockquote cite="mid:20080303122202(dot)GA4028(at)merkur(dot)hilbert(dot)loc"
type="cite">
<pre wrap="">Did you consider

- a maximum length up to which fields will indeed be wrapped ?
(\pset format aligned-wrapped 50)
this will prevent a really large text field being wrapped to
hundreds of lines thereby scrolling off everything else
</pre>
</blockquote>
Yes, but truncating the request with substr() seems to address this
need.  A large field restricted in height would just blow out the width
otherwise.<br>
<br>
<blockquote cite="mid:20080303122202(dot)GA4028(at)merkur(dot)hilbert(dot)loc"
type="cite">
<pre wrap="">
- ignoring wrapping bytea ?
</pre>
</blockquote>
Why treat bytea specially?  In many cases it's unlikely to make any
sense to print on a console anyway.  How would you want bytea
represented?<br>
 <br>
<blockquote cite="mid:20080303122202(dot)GA4028(at)merkur(dot)hilbert(dot)loc"
type="cite">
<pre wrap="">- allowing truncation of fields at a certain length before wrapping ?
(well, this can be handled by truncating at the SQL level, too)

Even without any of the above suggestions this will be a
*very* appreciated improvement of the already excellent
psql.
Karsten
</pre>
</blockquote>
</body>
</html>

Attachment Content-Type Size
unknown_filename text/html 2.2 KB

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message li ethan 2008-03-04 10:25:21 php to pgsql question
Previous Message Tom Lane 2008-03-03 16:12:28 Re: compiling plpython compilation error