Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fLLci-0006ml-0J for pgadmin-hackers@arkaria.postgresql.org; Wed, 23 May 2018 04:43:40 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fLLcd-0001OL-Uj for pgadmin-hackers@arkaria.postgresql.org; Wed, 23 May 2018 04:43:35 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fLLcd-0001OB-7Q for pgadmin-hackers@lists.postgresql.org; Wed, 23 May 2018 04:43:35 +0000 Received: from mail-wm0-x230.google.com ([2a00:1450:400c:c09::230]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1fLLcY-00068D-Rc for pgadmin-hackers@postgresql.org; Wed, 23 May 2018 04:43:33 +0000 Received: by mail-wm0-x230.google.com with SMTP id f6-v6so5172191wmc.4 for ; Tue, 22 May 2018 21:43:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=jfjMqPXfKsfFsIE6RuAs3hvvwcq6y5HcKaB5UksvUhw=; b=q4YLltmSai6A9/F0RFDVqm/J8B83OoSFDPCvB65+GWrhHFO/OS6wS6Bn2qZmJEmxuF 4P2h343HuR/kLhfjhV0N/tcNVqv3dUFmITDM32kXbwuuIDa13XugadS/cDZ79ueJRDb3 tMKN7MKzidCzvAP+YaP/+h6WLJbOAxYU26RbzUNeTQ4uWBq1j/HgnY5h11zHjb6VNLrK 8x6qk50FdPo/oDOdhLeq09LIA26ma6eWyhhJVCpsVGCpEzGNtnR+5OvzWXrfUB+Hra8L e6ciRcdq8wKxoX5Lv0V8C+t8CE/tfzwO3uQEDqF7gEl1pdRSgMcumuWfFR8Ju2hPI3WM 7cpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=jfjMqPXfKsfFsIE6RuAs3hvvwcq6y5HcKaB5UksvUhw=; b=apGExiEgK0PYED8u7FeD5FvATiQqR9YizWfYeEPQMMaWTj+tWlgCjROGWHn/npEPuS wdfCtPZ3OrRVxFxjMsyH9ySeXGlc8/LluorBdg3okyMF6wybNxLQW5S1maDLPxrzNAr6 WE8BXmknGwB0VDXedsXP7w6nR5dV2qOcvwcw0BT5rnnZh3QZK6sJ4jmBlsY42VAR2sqB hdDXqg+vbN1knoafCPboL/EAeyJKoA7HCAQ+8Bsp2YIRYrehOx9e9LqCFP0Gjx9qHDsy Qdck4FXmY4YwRS8PjscdXJ3VpMyv5CDfqb9CFOX1o/1dsVqYWMKANOksRkTUyvWIpBYQ cE7g== X-Gm-Message-State: ALKqPwdaoMRaXWKLrvn6sZD/ApqDnDqeJEH2nF5eQkRGbhG4W6GmqYPv XL1ljzrpcZnhuZlzKenCq3UfyHQG8qfAT+Oo6XlgUw== X-Google-Smtp-Source: AB8JxZondAZLA0kQsIwx9R2/gDVuSa/AHyg09E1kXl7DkXdkl/tbaCQeILnzylE0cnt9Pfi58upVFSmzh0S1bgOWOhA= X-Received: by 2002:a2e:934f:: with SMTP id m15-v6mr606704ljh.39.1527050607473; Tue, 22 May 2018 21:43:27 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a2e:9e8a:0:0:0:0:0 with HTTP; Tue, 22 May 2018 21:43:27 -0700 (PDT) In-Reply-To: References: From: Aditya Toshniwal Date: Wed, 23 May 2018 10:13:27 +0530 Message-ID: Subject: Re: [pgAdmin4][RM#3289] Can't query SQL_ASCII database. To: Victoria Henry Cc: Dave Page , pgadmin-hackers Content-Type: multipart/alternative; boundary="000000000000034a4d056cd82d93" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --000000000000034a4d056cd82d93 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Thank you Victoria, Anthony. Thanks and Regards, Aditya Toshniwal Software Engineer | EnterpriseDB Software Solutions | Pune "Don't Complain about Heat, Plant a tree" On Tue, May 22, 2018 at 7:15 PM, Victoria Henry wrote: > Hi Aditya, > > We made a minor change to make the patch so the python linter can pass. > Attached is the change we made. > Everything else looks good. > > Sincerely, > > Victoria & Anthony > > On Tue, May 22, 2018 at 4:46 AM Aditya Toshniwal enterprisedb.com> wrote: > >> Hi, >> >> PFA updated patch. Linter issues are fixed ( we dont have any linter >> setup for python :-( ) >> Regarding test cases, they run successfully on my system and the reason >> it failed for pivotal is timeout exception. I am sorry I can't help with >> that. >> >> Traceback (most recent call last): >> File "/tmp/build/a453582b/pgadmin-repo/web/pgadmin/feature_ >> tests/keyboard_shortcut_test.py", line 52, in runTest >> self._check_shortcuts() >> File "/tmp/build/a453582b/pgadmin-repo/web/pgadmin/feature_ >> tests/keyboard_shortcut_test.py", line 77, in _check_shortcuts >> ") and contains(@class, 'open')]") >> File "/root/.pyenv/versions/pgadmin36/lib/python3.6/site- >> packages/selenium/webdriver/support/wait.py", line 80, in until >> raise TimeoutException(message, screen, stacktrace) >> selenium.common.exceptions.TimeoutException: Message: >> >> Thanks and Regards, >> Aditya Toshniwal >> Software Engineer | EnterpriseDB Software Solutions | Pune >> "Don't Complain about Heat, Plant a tree" >> >> On Tue, May 22, 2018 at 1:37 PM, Dave Page wrote: >> >>> Hi >>> >>> Pivotal's buildbot is showing problems with this patch: >>> >>> https://gpdb-dev.bosh.pivotalci.info/teams/pgadmin/ >>> pipelines/pgadmin-patch/jobs/run-linter/builds/66 (linter failed) >>> https://gpdb-dev.bosh.pivotalci.info/teams/pgadmin/ >>> pipelines/pgadmin-patch/jobs/run-tests/builds/84 (tests failed) >>> >>> >>> On Tue, May 22, 2018 at 7:05 AM, Aditya Toshniwal >> enterprisedb.com> wrote: >>> >>>> Hi Hackers, >>>> >>>> PFA patch for RM#3289 where decode error was thrown on querying a >>>> SQL_ASCII database table. Please note, this problem occurs only on win= dows. >>>> Sample insert - insert into test_tab values ('=C3=A9'); >>>> >>>> psycopg2 has a encodings dictionary where Postgres Database Encodings >>>> are mapped to python equivalent. It uses 'ascii' decoder of python to >>>> decode for SQL_ASCII encoding. If data has characters beyond the limit= of >>>> ascii then it failed. The solution would be to use utf_8 decoder inste= ad of >>>> ascii. I tried setting the client_encoding using >>>> set_client_encoding('UTF8') method of a psycopg2 connection but no luc= k >>>> (also its not allowed for async connection). I also tried executing "S= ET >>>> CLIENT_ENCODING=3D'UTF8'" but it didn't work too. >>>> So, as in the patch, I had to set encodings dict value directly to >>>> 'utf_8' and it seems to be working. Please note, the same is added to >>>> psycopg3 milestones >>>> https://github.com/psycopg/psycopg2/milestone/4 >>>> >>>> Also fixed a small glitch for sql editor connection status check. >>>> >>>> Kindly review. >>>> >>>> Thanks and Regards, >>>> Aditya Toshniwal >>>> Software Engineer | EnterpriseDB Software Solutions | Pune >>>> "Don't Complain about Heat, Plant a tree" >>>> >>> >>> >>> >>> -- >>> Dave Page >>> Blog: http://pgsnake.blogspot.com >>> Twitter: @pgsnake >>> >>> EnterpriseDB UK: http://www.enterprisedb.com >>> The Enterprise PostgreSQL Company >>> >> >> --000000000000034a4d056cd82d93 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thank you Victoria, Anthony.

Thanks and Regards,
Aditya Toshniwal
Software Engine= er |=C2=A0EnterpriseDB Software Solutions |=C2=A0Pune
"Don&#= 39;t Complain about Heat, Plant a tree"

On Tue, May 22, 2018 at 7:15 PM, Victoria He= nry <vhenry@pivotal.io> wrote:
Hi Aditya,

We made a minor change = to make the patch so the python linter can pass.=C2=A0 Attached is the chan= ge we made.
Everything else looks good.

= Sincerely,

Victoria & Anthony

On Tue, May 22, 2018 at 4:46 AM Aditya Toshniwal <aditya.toshniwal@= enterprisedb.com> wrote:
Hi,

PFA updated patch. Linter issues = are fixed ( we dont have any linter setup for python :-( )
Regard= ing test cases, they run successfully on my system and the reason it failed= for pivotal is timeout exception. I am sorry I can't help with that.

Traceback (most recent call last):
=C2=A0 File "= /tmp/build/a453582b/pgadmin-repo/web/pgadmin/feature_tests/keyboa= rd_shortcut_test.py", line 52, in runTest
=C2=A0 =C2=A0 self._= check_shortcuts()
=C2=A0 File "/tmp/build/a453582b/pgadmin-rep= o/web/pgadmin/feature_tests/keyboard_shortcut_test.py", line= 77, in _check_shortcuts
=C2=A0 =C2=A0 ") and contains(@class, '= ;open')]")
=C2=A0 File "/root/.pyenv/versions/pgadmin= 36/lib/python3.6/site-packages/selenium/webdriver/support/wait.py= ", line 80, in until
=C2=A0 =C2=A0 raise TimeoutException(message, = screen, stacktrace)
selenium.common.exceptions.TimeoutException: Me= ssage:

Thanks and Regar= ds,
Aditya Toshniwal=
= Softwa= re Engineer |=C2=A0EnterpriseDB Software Solutions |=C2=A0Pune
&qu= ot;Don't Complain about Heat, Plant a tree"

On Tue, May 22, 2018 at 1:37 PM, Dave Page <= span dir=3D"ltr"><dpage@pgadmin.org> wrote:
=
Hi

Pivotal's buildbot is showing pr= oblems with this patch:


= On Tue, May 22, 2018 at 7:05 AM, Aditya Toshniwal <aditya.= toshniwal@enterprisedb.com> wrote:
Hi Hackers,

PF= A patch for RM#3289 where decode error was thrown on querying a SQL_ASCII d= atabase table. Please note, this problem occurs only on windows.
= Sample insert -=C2=A0insert into test_tab values ('=C3=A9');
<= div>
psycopg2 has a encodings dictionary where Postgres Datab= ase Encodings are mapped to python equivalent. It uses 'ascii' deco= der of python to decode for SQL_ASCII encoding. If data has characters beyo= nd the limit of ascii then it failed. The solution would be to use utf_8 de= coder instead of ascii. I tried setting the client_encoding using set_clien= t_encoding('UTF8') method of a psycopg2 connection but no luck (als= o its not allowed for async connection). I also tried executing "SET C= LIENT_ENCODING=3D'UTF8'" but it didn't work too.
So, as in the patch, I had to set encodings dict value directly to 'ut= f_8' and it seems to be working. Please note, the same is added to psyc= opg3 milestones

Also fixed a small glitch for sql edito= r connection status check.

Kindly review.
Thanks and Regards,
Aditya Toshniwal
Software Engineer |=C2=A0EnterpriseDB Soft= ware Solutions |=C2=A0Pune
=
"Don't Complain about Heat, Pl= ant a tree"



--
Dave= Page
Blog: ht= tp://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: = http://www.enterp= risedb.com
The Enterprise PostgreSQL Company


--000000000000034a4d056cd82d93--