Lists: | pgadmin-support |
---|
From: | Guy Rouillier <guyr(at)burntmail(dot)com> |
---|---|
To: | PgAdmin Support <pgadmin-support(at)postgresql(dot)org> |
Subject: | Column not wide enough for data |
Date: | 2011-12-21 03:29:49 |
Message-ID: | [email protected] |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Lists: | pgadmin-support |
I wanted to copy a table to another table, so I started by getting a
count of the rows in the source table. The result of "select count(*)
from xxxx" came out like this:
count
bigint
------
26569
Based on that, I concluded that a straightforward "insert into yyyy
select * from xxxx" would suffice and be done in no time. So I started
running that and then went on to something else.
About an hour and a half later, I realized that query was still running.
I thought that can't be right, so I cancelled the operation and
reissued the count. This time, I expanded the column and discovered the
actual count was
count
bigint
------
26569440
Since this count query produced a single column result, there is plenty
of room to expand the column on initial display. Is there a way to tell
PgAdmin to expand the column to fit the data? I could not find such an
option.
Thanks for such a great tool, I appreciate the years of effort that some
people have put into it.
--
Guy Rouillier
From: | Guillaume Lelarge <guillaume(at)lelarge(dot)info> |
---|---|
To: | Guy Rouillier <guyr(at)burntmail(dot)com> |
Cc: | PgAdmin Support <pgadmin-support(at)postgresql(dot)org> |
Subject: | Re: Column not wide enough for data |
Date: | 2012-01-02 21:40:57 |
Message-ID: | [email protected] |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Lists: | pgadmin-support |
On Tue, 2011-12-20 at 22:29 -0500, Guy Rouillier wrote:
> I wanted to copy a table to another table, so I started by getting a
> count of the rows in the source table. The result of "select count(*)
> from xxxx" came out like this:
>
> count
> bigint
> ------
> 26569
>
> Based on that, I concluded that a straightforward "insert into yyyy
> select * from xxxx" would suffice and be done in no time. So I started
> running that and then went on to something else.
>
> About an hour and a half later, I realized that query was still running.
> I thought that can't be right, so I cancelled the operation and
> reissued the count. This time, I expanded the column and discovered the
> actual count was
>
> count
> bigint
> ------
> 26569440
>
> Since this count query produced a single column result, there is plenty
> of room to expand the column on initial display. Is there a way to tell
> PgAdmin to expand the column to fit the data? I could not find such an
> option.
>
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.
And sorry for the late answer.
--
Guillaume
http://blog.guillaume.lelarge.info
http://www.dalibo.com
PostgreSQL Sessions #3: http://www.postgresql-sessions.org
From: | Guy Rouillier <guyr(at)burntmail(dot)com> |
---|---|
To: | pgadmin-support(at)postgresql(dot)org |
Subject: | Re: Column not wide enough for data |
Date: | 2012-01-03 02:29:26 |
Message-ID: | [email protected] |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Lists: | pgadmin-support |
On 1/2/2012 4:40 PM, Guillaume Lelarge wrote:
> On Tue, 2011-12-20 at 22:29 -0500, Guy Rouillier wrote:
>> I wanted to copy a table to another table, so I started by getting a
>> count of the rows in the source table. The result of "select count(*)
>> from xxxx" came out like this:
>>
>> count
>> bigint
>> ------
>> 26569
>>
>> Based on that, I concluded that a straightforward "insert into yyyy
>> select * from xxxx" would suffice and be done in no time. So I started
>> running that and then went on to something else.
>>
>> About an hour and a half later, I realized that query was still running.
>> I thought that can't be right, so I cancelled the operation and
>> reissued the count. This time, I expanded the column and discovered the
>> actual count was
>>
>> count
>> bigint
>> ------
>> 26569440
>>
>> Since this count query produced a single column result, there is plenty
>> of room to expand the column on initial display. Is there a way to tell
>> PgAdmin to expand the column to fit the data? I could not find such an
>> option.
>>
>
> 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.
>
> And sorry for the late answer.
Guillaume, thanks for the reply. No need for the apology, everyone is
busy around the holidays.
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.
Thanks.
--
Guy Rouillier
From: | Guillaume Lelarge <guillaume(at)lelarge(dot)info> |
---|---|
To: | Guy Rouillier <guyr(at)burntmail(dot)com> |
Cc: | pgadmin-support(at)postgresql(dot)org |
Subject: | Re: Column not wide enough for data |
Date: | 2012-01-04 21:59:56 |
Message-ID: | [email protected] |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Lists: | pgadmin-support |
On Mon, 2012-01-02 at 21:29 -0500, Guy Rouillier wrote:
> On 1/2/2012 4:40 PM, Guillaume Lelarge wrote:
> > On Tue, 2011-12-20 at 22:29 -0500, Guy Rouillier wrote:
> >> I wanted to copy a table to another table, so I started by getting a
> >> count of the rows in the source table. The result of "select count(*)
> >> from xxxx" came out like this:
> >>
> >> count
> >> bigint
> >> ------
> >> 26569
> >>
> >> Based on that, I concluded that a straightforward "insert into yyyy
> >> select * from xxxx" would suffice and be done in no time. So I started
> >> running that and then went on to something else.
> >>
> >> About an hour and a half later, I realized that query was still running.
> >> I thought that can't be right, so I cancelled the operation and
> >> reissued the count. This time, I expanded the column and discovered the
> >> actual count was
> >>
> >> count
> >> bigint
> >> ------
> >> 26569440
> >>
> >> Since this count query produced a single column result, there is plenty
> >> of room to expand the column on initial display. Is there a way to tell
> >> PgAdmin to expand the column to fit the data? I could not find such an
> >> option.
> >>
> >
> > 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.
> >
> > And sorry for the late answer.
>
> Guillaume, thanks for the reply. No need for the apology, everyone is
> busy around the holidays.
>
> 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.
--
Guillaume
http://blog.guillaume.lelarge.info
http://www.dalibo.com
PostgreSQL Sessions #3: http://www.postgresql-sessions.org
From: | Basil Bourque <basil(dot)bourque(dot)lists(at)pobox(dot)com> |
---|---|
To: | pgadmin-support(at)postgresql(dot)org |
Subject: | Re: Column not wide enough for data |
Date: | 2012-01-08 02:30:09 |
Message-ID: | [email protected] |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Lists: | pgadmin-support |
>>>> 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
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: | [email protected] |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
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
From: | Guillaume Lelarge <guillaume(at)lelarge(dot)info> |
---|---|
To: | Francisco Leovey <fleovey(at)yahoo(dot)com> |
Cc: | 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 16:09:02 |
Message-ID: | [email protected] |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Lists: | pgadmin-support |
On Sun, 2012-01-08 at 03:52 -0800, Francisco Leovey wrote:
> 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 %
>
Thanks for the idea, but no, that won't happen.
--
Guillaume
http://blog.guillaume.lelarge.info
http://www.dalibo.com
PostgreSQL Sessions #3: http://www.postgresql-sessions.org