Re: [pgAdmin4][Patch]: RM #3659 Query tool does not give warning when Auto Commit is turned on in an incomplete transaction

From: Dave Page <dpage(at)pgadmin(dot)org>
To: Akshay Joshi <akshay(dot)joshi(at)enterprisedb(dot)com>
Cc: pgadmin-hackers <pgadmin-hackers(at)postgresql(dot)org>
Subject: Re: [pgAdmin4][Patch]: RM #3659 Query tool does not give warning when Auto Commit is turned on in an incomplete transaction
Date: 2019-03-01 15:17:46
Message-ID: CA+OCxozz5co=m=+DtBopBayP+A5tb_hbQrYM=+0VwXO1BXR9gQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

Hi

On Fri, Mar 1, 2019 at 9:07 AM Akshay Joshi <akshay(dot)joshi(at)enterprisedb(dot)com>
wrote:

> Hi Hackers,
>
> Attached is the patch to fix RM #3659 "Query tool does not give warning
> when Auto Commit is turned on in an incomplete transaction".
>
> Please review it.
>

The behaviour doesn't seem quite right here. I see two issues:

1) It complains that a transaction is in progress if I try to turn
auto-commit on in a freshly opened Query Tool. As I haven't done anything
yet, I shouldn't get the warning. I think the logic to determine whether or
not we're in a transaction isn't correct.

2) In the case above, the setting is changed anyway. I think this has the
potential to be confusing (and potentially dangerous); we should only allow
the setting to actually be toggled when there's no transaction in progress.

Given 2), I wonder if we should remove the warning entirely, and just
disable the menu options whenever a transaction is in progress.

I've attached an updated patch - I started tweaking the messages, so please
base additional work from that.

Thanks.

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Attachment Content-Type Size
RM_3659_dave.patch application/octet-stream 11.6 KB

In response to

Responses

Browse pgadmin-hackers by date

  From Date Subject
Next Message pgAdmin 4 Jenkins 2019-03-01 15:22:14 Jenkins build is back to normal : pgadmin4-master-python36 #959
Previous Message pgAdmin 4 Jenkins 2019-03-01 15:06:31 Jenkins build is back to normal : pgadmin4-master-python37 #198