Re: Column not wide enough for data

From: Francisco Leovey <fleovey(at)yahoo(dot)com>
To: Basil Bourque <basil(dot)bourque(dot)lists(at)pobox(dot)com>, "pgadmin-support(at)postgresql(dot)org" <pgadmin-support(at)postgresql(dot)org>
Subject: Re: Column not wide enough for data
Date: 2012-01-08 11:52:18
Message-ID: 1326023538.81048.YahooMailNeo@web39306.mail.mud.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-support

Another way of doing it is to generate an HTML popup and let the browser decide the WIDTH of each column -

Using "table", "tr" and "td" the width is managed automaticaly or defining width as a %

________________________________
From: Basil Bourque <basil(dot)bourque(dot)lists(at)pobox(dot)com>
To: pgadmin-support(at)postgresql(dot)org
Sent: Saturday, January 7, 2012 11:30 PM
Subject: Re: [pgadmin-support] Column not wide enough for data

>>>>  I expanded the column and discovered the
>>>> actual count

>>>> Is there a way to tell
>>>> PgAdmin to expand the column to fit the data?
>>>
>>> No, there's no such option. If you resize the column afterwards, and
>>> then rerun the query, it'll keep the new column size. But right now,
>>> it's not smart enough to guess the width of the column. I suppose we
>>> don't do it yet because it would take a long time to do if you have a
>>> big number of rows and/or a big number of columns. We should probably
>>> revisit that.

>> I understand the problem that a large number of rows imposes on sizing
>> the column to fit the data.  Here is an alternative that is much easier
>> to implement.  By default, PgAdmin appears to allocate a fixed, equal
>> column width to all columns.  If the total width of all columns is less
>> than the display window, then divide the display window width by the
>> number of columns, and apply that equal width to all columns.  So if a
>> query produces a small number of columns, then they can be sized to fill
>> the display window.  In my case, with only a count result, the one
>> column would fill the entire width.
>
> That's an interesting idea. Not sure how much helpful wxWidgets will be
> with your idea, but it will be easy to check.

Another approach taken by other tools is to scan a small number of the rows to find the widest value. Say, the first 10 or 200 rows. Or whatever number seems reasonable.

--Basil Bourque

In response to

Responses

Browse pgadmin-support by date

  From Date Subject
Next Message Guillaume Lelarge 2012-01-08 16:09:02 Re: Column not wide enough for data
Previous Message Basil Bourque 2012-01-08 02:30:09 Re: Column not wide enough for data