pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bryce Nesbitt <bryce2@obviously.com>
To: sql pgsql <pgsql-sql@postgresql.org>
Cc: Karsten Hilbert <Karsten.Hilbert@gmx.net>
Subject: Re: psql word wrapping to terminal width - testers?
Date: Mon, 03 Mar 2008 11:30:07 -0800
Message-ID: <47CC51BF.8050209@obviously.com> (raw)
In-Reply-To: <20080303122202.GA4028@merkur.hilbert.loc>
References: <47CB98AB.1040807@obviously.com>
	<20080303122202.GA4028@merkur.hilbert.loc>

<!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.GA4028@merkur.hilbert.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.GA4028@merkur.hilbert.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.GA4028@merkur.hilbert.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.GA4028@merkur.hilbert.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>



view thread (2+ messages)

Message-ID: <47CC51BF.8050209@obviously.com>
Permalink:  ../47CC51BF.8050209@obviously.com/
Also on:    postgresql.org/message-id/47CC51BF.8050209@obviously.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: bryce2@obviously.com, Karsten.Hilbert@gmx.net
  Subject: Re: psql word wrapping to terminal width - testers?
  In-Reply-To: <47CC51BF.8050209@obviously.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox