Re: [pgAdmin4][Patch]: Fix the logic to extract the error in Query tool
От | Dave Page |
---|---|
Тема | Re: [pgAdmin4][Patch]: Fix the logic to extract the error in Query tool |
Дата | |
Msg-id | CA+OCxoz=4j5hjSet0jXFreh9fPY5aH3Zafx4fwEpboUVQGb21A@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: [pgAdmin4][Patch]: Fix the logic to extract the error in Query tool (Murtuza Zabuawala <murtuza.zabuawala@enterprisedb.com>) |
Список | pgadmin-hackers |
Thanks - applied!
On Tue, Sep 19, 2017 at 8:55 AM, Murtuza Zabuawala <murtuza.zabuawala@enterprisedb.com> wrote:
Hi Dave,Please find updated patch, I have tested following scenarios in query tool,1) To test if we highlight faulty syntaxSQL: select a from pg_roles;2) To check duplicates in error messages.- Open query tool- Uncheck Auto-Commit and run below sql 3 times and you will get an errorSQL: select a from pg_roles;3) To check proper errorSQL: --insert into pg_roles values(1);4) To check duplicates in error messages.SQL: insert into pg_roles values(1);5) Tested RAISE notices from function.6) Tested JS testcasesPlease review and let me know if I missed anything.Regards,MurtuzaOn Mon, Sep 18, 2017 at 8:20 PM, Dave Page <dpage@pgadmin.org> wrote:HiOn Mon, Sep 18, 2017 at 3:08 PM, Murtuza Zabuawala <murtuza.zabuawala@enterprisedb.com> wrote: Hi Dave,Sorry my bad, I didn't check the backend code, I assumed that it is coming from psycopg2 and so I was focusing it to remove from client side :(PFA updated patch.I think it needs to be a bit smarter than that. Whilst it works well for the "empty query" message, it doesn't work well for errors that have full details. For instance, instead of:======================================================== ERROR: relation "pg_foo" does not existLINE 1: select * from pg_foo^********** Error **********ERROR: relation "pg_foo" does not existSQL state: 42P01Character: 15======================================================== We now get:======================================================== ERROR: ERROR: relation "pg_foo" does not existLINE 1: select * from pg_foo^ERROR: relation "pg_foo" does not existSQL state: 42P01Character: 15======================================================== Done--Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
В списке pgadmin-hackers по дате отправления: