Thread: [pgAdmin4][Patch] Add formatted error message support in psycopg2
Hi All
While implementing Query Tool, I came to know we need error message's with some extra information and also I have faced one issue regarding asynchronous connection polling. I have added support for formatted error message and also fixed the issue.
Attached is the patch file. Please review it and let me know the review comments if any.
--

Akshay Joshi
Principal Software Engineer

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

On Tue, Mar 29, 2016 at 8:09 PM, Akshay Joshi <akshay.joshi@enterprisedb.com> wrote:
Hi AllWhile implementing Query Tool, I came to know we need error message's with some extra information and also I have faced one issue regarding asynchronous connection polling. I have added support for formatted error message and also fixed the issue.Attached is the patch file. Please review it and let me know the review comments if any.
Apart from above, today I fixed one more issue. In case of user cancel the running transaction, poll function of psycopg2 returns psycopg2.extensions.POLL_OK, which is mislead by the caller of the function, so I have added one flag which will be true if user purposely cancel the transaction and from our poll function we return new status i.e. ASYNC_CANCEL_TRANSACTION.
Attached is the modified patch. Please review it and if it looks good please commit it.
--Akshay JoshiPrincipal Software EngineerPhone: +91 20-3058-9517
Mobile: +91 976-788-8246
Akshay Joshi
Principal Software Engineer

Phone: +91 20-3058-9517
Mobile: +91 976-788-8246
Mobile: +91 976-788-8246
Attachment
Hi
Please ignore the last two patches, While implementing Query Tool I have found one more issue in poll function when run queries like "create table" , "insert table". I have added exception handling before fetching the row from the cursor directly.
Attached is the modified patch. Please review it and if it looks good please commit it.
On Thu, Mar 31, 2016 at 12:37 PM, Akshay Joshi <akshay.joshi@enterprisedb.com> wrote:
HiOn Tue, Mar 29, 2016 at 8:09 PM, Akshay Joshi <akshay.joshi@enterprisedb.com> wrote:Hi AllWhile implementing Query Tool, I came to know we need error message's with some extra information and also I have faced one issue regarding asynchronous connection polling. I have added support for formatted error message and also fixed the issue.Attached is the patch file. Please review it and let me know the review comments if any.Apart from above, today I fixed one more issue. In case of user cancel the running transaction, poll function of psycopg2 returns psycopg2.extensions.POLL_OK, which is mislead by the caller of the function, so I have added one flag which will be true if user purposely cancel the transaction and from our poll function we return new status i.e. ASYNC_CANCEL_TRANSACTION.Attached is the modified patch. Please review it and if it looks good please commit it.--Akshay JoshiPrincipal Software EngineerPhone: +91 20-3058-9517
Mobile: +91 976-788-8246--Akshay JoshiPrincipal Software EngineerPhone: +91 20-3058-9517
Mobile: +91 976-788-8246
Akshay Joshi
Principal Software Engineer

Phone: +91 20-3058-9517
Mobile: +91 976-788-8246
Mobile: +91 976-788-8246
Attachment
Hi Akshay,
I've update the patch a little bit as discussed offline.
Also, renamed the variable 'is_cancel_transaction' to 'execution_aborted', and enum value to 'ASYNC_EXECUTION_ABORTED'.
On Thu, Mar 31, 2016 at 4:55 PM, Akshay Joshi <akshay.joshi@enterprisedb.com> wrote:
HiPlease ignore the last two patches, While implementing Query Tool I have found one more issue in poll function when run queries like "create table" , "insert table". I have added exception handling before fetching the row from the cursor directly.Attached is the modified patch. Please review it and if it looks good please commit it.On Thu, Mar 31, 2016 at 12:37 PM, Akshay Joshi <akshay.joshi@enterprisedb.com> wrote:HiOn Tue, Mar 29, 2016 at 8:09 PM, Akshay Joshi <akshay.joshi@enterprisedb.com> wrote:Hi AllWhile implementing Query Tool, I came to know we need error message's with some extra information and also I have faced one issue regarding asynchronous connection polling. I have added support for formatted error message and also fixed the issue.Attached is the patch file. Please review it and let me know the review comments if any.Apart from above, today I fixed one more issue. In case of user cancel the running transaction, poll function of psycopg2 returns psycopg2.extensions.POLL_OK, which is mislead by the caller of the function, so I have added one flag which will be true if user purposely cancel the transaction and from our poll function we return new status i.e. ASYNC_CANCEL_TRANSACTION.Attached is the modified patch. Please review it and if it looks good please commit it.--Akshay JoshiPrincipal Software EngineerPhone: +91 20-3058-9517
Mobile: +91 976-788-8246--Akshay JoshiPrincipal Software EngineerPhone: +91 20-3058-9517
Mobile: +91 976-788-8246--Akshay JoshiPrincipal Software EngineerPhone: +91 20-3058-9517
Mobile: +91 976-788-8246
--
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers
Attachment
Hi
--

On Fri, Apr 1, 2016 at 3:53 PM, Ashesh Vashi <ashesh.vashi@enterprisedb.com> wrote:
Hi Akshay,I've update the patch a little bit as discussed offline.Also, renamed the variable 'is_cancel_transaction' to 'execution_aborted', and enum value to 'ASYNC_EXECUTION_ABORTED'.
As per our discussion I have modified the logic and attached is the updated patch.
Please review it.
On Thu, Mar 31, 2016 at 4:55 PM, Akshay Joshi <akshay.joshi@enterprisedb.com> wrote:--HiPlease ignore the last two patches, While implementing Query Tool I have found one more issue in poll function when run queries like "create table" , "insert table". I have added exception handling before fetching the row from the cursor directly.Attached is the modified patch. Please review it and if it looks good please commit it.On Thu, Mar 31, 2016 at 12:37 PM, Akshay Joshi <akshay.joshi@enterprisedb.com> wrote:HiOn Tue, Mar 29, 2016 at 8:09 PM, Akshay Joshi <akshay.joshi@enterprisedb.com> wrote:Hi AllWhile implementing Query Tool, I came to know we need error message's with some extra information and also I have faced one issue regarding asynchronous connection polling. I have added support for formatted error message and also fixed the issue.Attached is the patch file. Please review it and let me know the review comments if any.Apart from above, today I fixed one more issue. In case of user cancel the running transaction, poll function of psycopg2 returns psycopg2.extensions.POLL_OK, which is mislead by the caller of the function, so I have added one flag which will be true if user purposely cancel the transaction and from our poll function we return new status i.e. ASYNC_CANCEL_TRANSACTION.Attached is the modified patch. Please review it and if it looks good please commit it.--Akshay JoshiPrincipal Software EngineerPhone: +91 20-3058-9517
Mobile: +91 976-788-8246--Akshay JoshiPrincipal Software EngineerPhone: +91 20-3058-9517
Mobile: +91 976-788-8246--Akshay JoshiPrincipal Software EngineerPhone: +91 20-3058-9517
Mobile: +91 976-788-8246
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers
Akshay Joshi
Principal Software Engineer

Phone: +91 20-3058-9517
Mobile: +91 976-788-8246
Mobile: +91 976-788-8246
Attachment
Committed with minor change.
On Fri, Apr 1, 2016 at 5:17 PM, Akshay Joshi <akshay.joshi@enterprisedb.com> wrote:
HiOn Fri, Apr 1, 2016 at 3:53 PM, Ashesh Vashi <ashesh.vashi@enterprisedb.com> wrote:Hi Akshay,I've update the patch a little bit as discussed offline.Also, renamed the variable 'is_cancel_transaction' to 'execution_aborted', and enum value to 'ASYNC_EXECUTION_ABORTED'.As per our discussion I have modified the logic and attached is the updated patch.Please review it.On Thu, Mar 31, 2016 at 4:55 PM, Akshay Joshi <akshay.joshi@enterprisedb.com> wrote:--HiPlease ignore the last two patches, While implementing Query Tool I have found one more issue in poll function when run queries like "create table" , "insert table". I have added exception handling before fetching the row from the cursor directly.Attached is the modified patch. Please review it and if it looks good please commit it.On Thu, Mar 31, 2016 at 12:37 PM, Akshay Joshi <akshay.joshi@enterprisedb.com> wrote:HiOn Tue, Mar 29, 2016 at 8:09 PM, Akshay Joshi <akshay.joshi@enterprisedb.com> wrote:Hi AllWhile implementing Query Tool, I came to know we need error message's with some extra information and also I have faced one issue regarding asynchronous connection polling. I have added support for formatted error message and also fixed the issue.Attached is the patch file. Please review it and let me know the review comments if any.Apart from above, today I fixed one more issue. In case of user cancel the running transaction, poll function of psycopg2 returns psycopg2.extensions.POLL_OK, which is mislead by the caller of the function, so I have added one flag which will be true if user purposely cancel the transaction and from our poll function we return new status i.e. ASYNC_CANCEL_TRANSACTION.Attached is the modified patch. Please review it and if it looks good please commit it.--Akshay JoshiPrincipal Software EngineerPhone: +91 20-3058-9517
Mobile: +91 976-788-8246--Akshay JoshiPrincipal Software EngineerPhone: +91 20-3058-9517
Mobile: +91 976-788-8246--Akshay JoshiPrincipal Software EngineerPhone: +91 20-3058-9517
Mobile: +91 976-788-8246
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers--Akshay JoshiPrincipal Software EngineerPhone: +91 20-3058-9517
Mobile: +91 976-788-8246