proposal: psql - breaking rows in white chars for wrapped format

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: PostgreSQL-development Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: proposal: psql - breaking rows in white chars for wrapped format
Date: 2009-03-02 18:24:57
Message-ID: 162867790903021024j66d1a282v34a97b9e1a271bef@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello

Current wrapped format doesn't break rows well (after white chars). I
propose change this behave (to more typical for text):

Current:

postgres=# \pset format wrappedOutput format is wrapped.
postgres=# select a from test;
a
--------------------------------------------------------
There are many variations of passages of Lorem Ipsum a
vailable, but the majority have suffered alteration in
some form, by injected humour, or randomised words wh
ich don't look even slightly believable. If you are go
ing to use a passage of Lorem Ipsum, you need to be su
re there isn't anything embarrassing hidden in the mid
dle of text. All the Lorem Ipsum generators on the Int
ernet tend to repeat predefined chunks as necessary, m
aking this the first true generator on the Internet. I
t uses a dictionary of over 200 Latin words, combined
with a handful of model sentence structures, to genera
te Lorem Ipsum which looks reasonable. The generated L
orem Ipsum is therefore always free from repetition, i
njected humour, or non-characteristic words etc.
(1 row)

Proposal:
postgres=# \pset format wrapped
Output format is wrapped.
postgres=# select a from test;
a
--------------------------------------------------------
There are many variations of passages of Lorem Ipsum
available, but the majority have suffered alteration
in some form, by injected humour, or randomised words
which don't look even slightly believable. If you are
going to use a passage of Lorem Ipsum, you need to be
sure there isn't anything embarrassing hidden in the
middle of text. All the Lorem Ipsum generators on the
Internet tend to repeat predefined chunks as
necessary, making this the first true generator on the
Internet. It uses a dictionary of over 200 Latin
words, combined with a handful of model sentence
structures, to generate Lorem Ipsum which looks
reasonable. The generated Lorem Ipsum is therefore
always free from repetition, injected humour, or
non-characteristic words etc.
(1 row)

It should be implemented via checking white chars inside
strlen_max_width function.

any notices, ideas welcome

regards
Pavel Stehule

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2009-03-02 18:34:25 Re: proposal: psql - breaking rows in white chars for wrapped format
Previous Message Greg Stark 2009-03-02 16:55:50 Re: regression test crashes at tsearch