From: | Sergey Muraviov <sergey(dot)k(dot)muraviov(at)gmail(dot)com> |
---|---|
To: | Sameer Thakur <samthakur74(at)gmail(dot)com> |
Cc: | Jeff Janes <jeff(dot)janes(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: Problem with displaying "wide" tables in psql |
Date: | 2013-12-18 09:29:37 |
Message-ID: | CAJTaR30PA1LLcgaDfcvb1zn80e=cruWTq9-9rv0FFe4HioOeQQ@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Hello
2013/12/18 Sameer Thakur <samthakur74(at)gmail(dot)com>
> On Wed, Dec 11, 2013 at 11:13 PM, Sergey Muraviov
> <sergey(dot)k(dot)muraviov(at)gmail(dot)com> wrote:
> > Hi.
> >
> > I've improved the patch.
> > It works in expanded mode when either format option is set to wrapped
> (\pset
> > format wrapped), or we have no pager, or pager doesn't chop long lines
> (so
> > you can still use the trick).
> > Target output width is taken from either columns option (\pset columns
> 70),
> > or environment variable $COLUMNS, or terminal size.
> > And it's also compatible with any border style (\pset border 0|1|2).
> >
> > Here are some examples:
> >
> > postgres=# \x 1
> > postgres=# \pset format wrapped
> > postgres=# \pset border 0
> > postgres=# select * from wide_table;
> > * Record 1
> > value afadsafasd fasdf asdfasd fsad fas df sadf sad f sadf sadf sa df
> > sadfsadfa
> > sd fsad fsa df sadf asd fa sfd sadfsadf asdf sad f sadf sad fadsf
> > * Record 2
> > value afadsafasd fasdf asdfasd
> >
> > postgres=# \pset border 1
> > postgres=# \pset columns 70
> > postgres=# select * from wide_table;
> > -[ RECORD 1 ]---------------------------------------------------------
> > value | afadsafasd fasdf asdfasd fsad fas df sadf sad f sadf sadf sa
> > | df sadfsadfasd fsad fsa df sadf asd fa sfd sadfsadf asdf sad f
> > | sadf sad fadsf
> > -[ RECORD 2 ]---------------------------------------------------------
> > value | afadsafasd fasdf asdfasd
> >
> > postgres=# \pset border 2
> > postgres=# \pset columns 60
> > postgres=# select * from wide_table;
> > +-[ RECORD 1 ]---------------------------------------------+
> > | value | afadsafasd fasdf asdfasd fsad fas df sadf sad f |
> > | | sadf sadf sa df sadfsadfasd fsad fsa df sadf as |
> > | | d fa sfd sadfsadf asdf sad f sadf sad fadsf |
> > +-[ RECORD 2 ]---------------------------------------------+
> > | value | afadsafasd fasdf asdfasd |
> > +-------+--------------------------------------------------+
> >
> > Regards,
> > Sergey
> >
>
> The patch applies and compile cleanly. I tried the following
> \pset format wrapped
> \pset columns 70.
> Not in expanded mode
> select * from wide_table works fine.
> select * from pg_stats has problems in viewing. Is it that pg_stats
> can be viewed easily only in expanded mode i.e. if columns displayed
> are wrapped then there is no way to view results in non expanded mode?
> regards
> Sameer
>
The problem with non expanded mode is that all column headers have to be
displayed on one line.
Otherwise, it is difficult to bind values to columns.
And I have no idea how to solve this problem.
--
Best regards,
Sergey Muraviov
From | Date | Subject | |
---|---|---|---|
Next Message | Craig Ringer | 2013-12-18 09:36:36 | Re: stats for network traffic WIP |
Previous Message | Tatsuo Ishii | 2013-12-18 09:18:06 | Re: Proposal: variant of regclass |