Thread: output screen in psql

output screen in psql

From
abcdef
Date:
Hi, I use postgres in red hat linux .
When I use psql and select the content of the table .
I find the format is not tidy .
I change align and unalign , the output is not filful my requirement.
Any special setting that can change the line size like oralce to fit my
requirement ???
So, the whole table can be view within the screen of psql ???

===============
kwokdb=#  select * from issue;
 issue_id |                   issue_name                   |
issue_description                  | issue_assig
nee | issue_url | issue_type | issue_status | issue_priority |
issue_resolution | duplicate_id | creator |     creation_date
    | modifier |   modification_date   |   issue_due_date    |  creator_ip
| issue_created_from_email | issue_modified_from
_email

----------+------------------------------------------------+----------------------------------------------------+------------

----+-----------+------------+--------------+----------------+------------------+--------------+---------+-------------------

----+----------+-----------------------+---------------------+---------------+--------------------------+--------------------
-------
        3 | computer cannot power up                       | test data:
computer cannot power up                |
  1 |           |          2 |            8 |             16 |
20 |              |       1 | 2011-03-08 12:16:2
6.4 |          |                       | 2011-03-31 00:00:00 | 192.168.1.143
|

======================
kwokdb=# select * from issue;

issue_id|issue_name|issue_description|issue_assignee|issue_url|issue_type|issue_status|issue_priority|issue_resolution|duplicate_id|creator|creation_date|modifier|modification_date|issue_due_date|creator_ip|issue_created_from_email|issue_modified_from_email
3|computer cannot power up|test data: computer cannot power
up|1||2|8|16|20||1|2011-03-08 12:16:26.4|||2011-03-31
00:00:00|192.168.1.143||
4|VMware workstation cannot install in XP|test data: Vmware workstation
cannot install in XP|4||4|8|16|23||4|2011-03-08
13:54:53.4||||192.168.1.143||
5|User cannot connect to wireless router by WIFI|User cannot connect to
wireless router by WIFI|1||2|7|15|19||4|2011-03-08 14:03:37.1|||2011-03-29
00:00:00|192.168.1.143||


--
View this message in context: http://postgresql.1045698.n5.nabble.com/output-screen-in-psql-tp3422631p3422631.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.

Re: output screen in psql

From
Pavel Stehule
Date:
Hello

2011/3/10 abcdef <chuikingman@gmail.com>:
> Hi, I use postgres in red hat linux .
> When I use psql and select the content of the table .
> I find the format is not tidy .
> I change align and unalign , the output is not filful my requirement.
> Any special setting that can change the line size like oralce to fit my
> requirement ???
> So, the whole table can be view within the screen of psql ???
>

try wrap mode http://archives.postgresql.org/pgsql-committers/2008-05/msg00126.php

you can try http://www.pgsql.cz/index.php/PostgreSQL_SQL_Tricks#psql_together_with_less


Regards

Pavel Stehule

> ===============
> kwokdb=#  select * from issue;
>  issue_id |                   issue_name                   |
> issue_description                  | issue_assig
> nee | issue_url | issue_type | issue_status | issue_priority |
> issue_resolution | duplicate_id | creator |     creation_date
>    | modifier |   modification_date   |   issue_due_date    |  creator_ip
> | issue_created_from_email | issue_modified_from
> _email
>
----------+------------------------------------------------+----------------------------------------------------+------------
>
----+-----------+------------+--------------+----------------+------------------+--------------+---------+-------------------
>
----+----------+-----------------------+---------------------+---------------+--------------------------+--------------------
> -------
>        3 | computer cannot power up                       | test data:
> computer cannot power up                |
>  1 |           |          2 |            8 |             16 |
> 20 |              |       1 | 2011-03-08 12:16:2
> 6.4 |          |                       | 2011-03-31 00:00:00 | 192.168.1.143
> |
>
> ======================
> kwokdb=# select * from issue;
>
issue_id|issue_name|issue_description|issue_assignee|issue_url|issue_type|issue_status|issue_priority|issue_resolution|duplicate_id|creator|creation_date|modifier|modification_date|issue_due_date|creator_ip|issue_created_from_email|issue_modified_from_email
> 3|computer cannot power up|test data: computer cannot power
> up|1||2|8|16|20||1|2011-03-08 12:16:26.4|||2011-03-31
> 00:00:00|192.168.1.143||
> 4|VMware workstation cannot install in XP|test data: Vmware workstation
> cannot install in XP|4||4|8|16|23||4|2011-03-08
> 13:54:53.4||||192.168.1.143||
> 5|User cannot connect to wireless router by WIFI|User cannot connect to
> wireless router by WIFI|1||2|7|15|19||4|2011-03-08 14:03:37.1|||2011-03-29
> 00:00:00|192.168.1.143||
>
>
> --
> View this message in context: http://postgresql.1045698.n5.nabble.com/output-screen-in-psql-tp3422631p3422631.html
> Sent from the PostgreSQL - general mailing list archive at Nabble.com.
>
> --
> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>

Re: output screen in psql

From
Bill Thoen
Date:
On Wed, Mar 09, 2011 at 05:51:51PM -0800, abcdef wrote:
> Hi, I use postgres in red hat linux .
> When I use psql and select the content of the table .
> I find the format is not tidy .
> I change align and unalign , the output is not filful my requirement.
> Any special setting that can change the line size like oralce to fit my
> requirement ???
> So, the whole table can be view within the screen of psql ???
>


I use \x to toggle between block display and row display. And if you log in
using ssh on Linux, you can zoom in and out with Ctrl-Shift + and Ctrl-Shft
- (Hold down the control and shift keys press the plus key to zoom in
  (increase the font size), or the minus key to decrease it.