Обсуждение: psql output Horizontal scrollable ?

Поиск
Список
Период
Сортировка

psql output Horizontal scrollable ?

От
Frank Hu
Дата:
Hi guys,
 
I am new to this database, so forgive me if this is too novice.
I would like to know if there is any way to set the psql command output horizontal scrollable ? I mean sometimes when the table has too many columns, or a column has too long text, the output would be several lines for a "row" of output, which make it very hard to read. So any one has any solutions ?
 
Thanks a lot.
Frank
 


Yahoo! FareChase - Search multiple travel sites in one click.

Re: psql output Horizontal scrollable ?

От
Sean Davis
Дата:
On 11/11/05 12:03 PM, "Frank Hu" <franksub2005@yahoo.com> wrote:

> Hi guys,
>
> I am new to this database, so forgive me if this is too novice.
> I would like to know if there is any way to set the psql command output
> horizontal scrollable ? I mean sometimes when the table has too many columns,
> or a column has too long text, the output would be several lines for a "row"
> of output, which make it very hard to read. So any one has any solutions ?

This is more a function of the terminal that psql is running in, I think.
Have you looked at using something like phpPgAdmin or pgAdminIII?  They have
"prettyier" output.

Sean


Re: psql output Horizontal scrollable ?

От
"Greg Sabino Mullane"
Дата:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


> I am new to this database, so forgive me if this is too novice.
> I would like to know if there is any way to set the psql command
> output horizontal scrollable ?

One solution is to check out the "expanded" output mode, which can
be very handy in psql. Just toggle it on and off with \x

As far as the scrolling, that is set to whatever your pager is
set to. On unix-like systems, this is set with the environment
variable PAGER. The popular pager called "less" has horizontal
scrolling capability: just hit the right arrow and you will switch
to that mode. Another thing you may want to do is make sure the
pager is always used by psql by setting "\pset pager always"

So in summary, try this:

export PAGER=less
(call psql)
\pset pager always
(run your commands, hit the right arrow)

If you find yourself using the same commands all the time, such
as \pset pager always, you can add them to your .psqlrc file
(in your home directory) and they will be called automatically each
time you start psql.

All of the above assumes a bash shell on a unixy system, so if it
does not work for you, let us know what OS you are running on for
a better answer.

- --
Greg Sabino Mullane greg@turnstep.com
PGP Key: 0x14964AC8 200511111250
http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8
-----BEGIN PGP SIGNATURE-----

iD8DBQFDdNpXvJuQZxSWSsgRAlMSAKDwNLhTQJ42GZbKJbKIF5NHCt28UQCffPuP
75utEbOUrN02PYhMjK/Unzg=
=huVd
-----END PGP SIGNATURE-----