Обсуждение: Displaying a wide column with psql

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

Displaying a wide column with psql

От
Philip Rhoades
Дата:
People,

I have a table with a field that has up to 1,000 chars in it, when I
look at it with psql it only displays about 200 chars with a "…"
on the end of the string.  Even when I look at just one record and use
the \x option I get the same result - I googled for ages but short of
using pg_dump, I couldn't see an interactive way of seeing the whole
field.  Is it possible?

Thanks,

Phil.
--
Philip Rhoades

GPO Box 3411
Sydney NSW    2001
Australia
E-mail:  phil@pricom.com.au






Re: Displaying a wide column with psql

От
Adrian Klaver
Дата:
On 09/01/2014 08:05 PM, Philip Rhoades wrote:
> People,
>
> I have a table with a field that has up to 1,000 chars in it, when I
> look at it with psql it only displays about 200 chars with a "…"
> on the end of the string.  Even when I look at just one record and use
> the \x option I get the same result - I googled for ages but short of
> using pg_dump, I couldn't see an interactive way of seeing the whole
> field.  Is it possible?

Have you tried \pset format wrapped?

http://www.postgresql.org/docs/9.3/interactive/app-psql.html

\pset
>
> Thanks,
>
> Phil.


--
Adrian Klaver
adrian.klaver@aklaver.com


Re: Displaying a wide column with psql

От
David G Johnston
Дата:
Adrian Klaver-4 wrote
> On 09/01/2014 08:05 PM, Philip Rhoades wrote:
>> People,
>>
>> I have a table with a field that has up to 1,000 chars in it, when I
>> look at it with psql it only displays about 200 chars with a "…"
>> on the end of the string.  Even when I look at just one record and use
>> the \x option I get the same result - I googled for ages but short of
>> using pg_dump, I couldn't see an interactive way of seeing the whole
>> field.  Is it possible?
>
> Have you tried \pset format wrapped?
>
> http://www.postgresql.org/docs/9.3/interactive/app-psql.html
>
> \pset
>>
>> Thanks,
>>
>> Phil.

Philip: Can you get it to reproduce without the table?

I did:

SELECT repeat('x',10000);

with various incantation of

\x (on/off)
\pset format wrapped/unaligned

And could not get it to reproduce with 9.3 psql on 9.0 server

I presume what you are seeing is effectively: "this is some really long
con..." where the content is truncated and replaced a final trailing three
periods (possible actual ellipses)

Also, are you sure you are not sending this to a pager?

David J.




--
View this message in context:
http://postgresql.1045698.n5.nabble.com/Displaying-a-wide-column-with-psql-tp5817275p5817285.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.


Re: Displaying a wide column with psql

От
Tom Lane
Дата:
David G Johnston <david.g.johnston@gmail.com> writes:
>> On 09/01/2014 08:05 PM, Philip Rhoades wrote:
>>> I have a table with a field that has up to 1,000 chars in it, when I
>>> look at it with psql it only displays about 200 chars with a "…"
>>> on the end of the string.

> I presume what you are seeing is effectively: "this is some really long
> con..." where the content is truncated and replaced a final trailing three
> periods (possible actual ellipses)
> Also, are you sure you are not sending this to a pager?

Yeah, it's pretty hard to credit this happening in a vanilla
configuration.  I suspect that Philip either has some nondefault
\pset option selected, or is sending his output to a pager program
that thinks that the ellipsis is a good idea.

For starters, try "\pset pager off" and see if you still see the
ellipsis after that.  If so, we'll need some more info about exactly
which PG version you're using and with what \pset options.  If you
have a ~/.psqlrc file, that's probably what's setting nondefault options.

            regards, tom lane