Re: [pgAdmin4][Patch]: RM 1789 Column width of data output panel should fit to data (as pgAdmin III)

From: Akshay Joshi <akshay(dot)joshi(at)enterprisedb(dot)com>
To: Dave Page <dpage(at)pgadmin(dot)org>
Cc: pgadmin-hackers <pgadmin-hackers(at)postgresql(dot)org>
Subject: Re: [pgAdmin4][Patch]: RM 1789 Column width of data output panel should fit to data (as pgAdmin III)
Date: 2016-12-09 08:45:43
Message-ID: CANxoLDeoR40-1mgiB8=LN3FaFdX5J2ViJA3bE9NF=4cHO38SmQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

Hi Dave

On Fri, Oct 28, 2016 at 8:43 PM, Dave Page <dpage(at)pgadmin(dot)org> wrote:

> Hi
>
> On Fri, Oct 28, 2016 at 7:04 AM, Akshay Joshi <
> akshay(dot)joshi(at)enterprisedb(dot)com> wrote:
>
>> Hi All
>>
>> Please find the attached patch to fix the RM #1789 Column width of data
>> output panel should fit to data (as pgAdmin III).
>>
>>
> This doesn't seem to work as expected:
>
> 1) The columns are resized, but equally. For example, given a query of
> "SELECT * FROM pg_description", I would expect the first 3 columns to be
> roughly the size they are without the patch, and the 4th column to be much
> wider (in the ticket I suggested the width of the content, up to a maximum
> of 33% of the width of the container).
>

We will have to set the width of columns depending on the *data type*
for example all the numeric/integers we can set the column width = 80(may
change), for boolean we can set it up to 50, for strings/timestamps/bytea/
jsonb/.. we can set the width equal to 33% of the width of the container. I
am not sure how we can find the width of the content. Please suggest is
this approach looks good to you?

>
> 2) After executing a second query (which works as expected), further
> queries fail to update the resultset. I was selecting from pg_class,
> pg_attribute and pg_description, and repeatedly found (no matter what order
> I queried each table), only the first two queries returned the expected
> results. The third and subsequent always re-displayed the results of the
> second query. Reverting the patch caused this issue to go away.
>

There was an error in background due to "*forceFitColumns = true*"
option of the SlickGrid. I have remove that logic.

>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>

--
*Akshay Joshi*
*Principal Software Engineer *

*Phone: +91 20-3058-9517Mobile: +91 976-788-8246*

In response to

Responses

Browse pgadmin-hackers by date

  From Date Subject
Next Message Ashesh Vashi 2016-12-09 09:16:23 PATCH: RM# 1679 - Background process for "restore" not reporting status back to pgAdmin
Previous Message Akshay Joshi 2016-12-09 06:37:08 Re: [pgAdmin4][Patch]: RM #1994 Insert / update are truncating if column is character