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 1fW6nR-0007TW-2O for pgadmin-hackers@arkaria.postgresql.org; Thu, 21 Jun 2018 21:07:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fW6nP-0004Dx-8Y for pgadmin-hackers@arkaria.postgresql.org; Thu, 21 Jun 2018 21:07:11 +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 1fW6nO-0004Dq-Rq for pgadmin-hackers@lists.postgresql.org; Thu, 21 Jun 2018 21:07:11 +0000 Received: from mail-wm0-x22d.google.com ([2a00:1450:400c:c09::22d]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1fW6nK-0001cm-MU for pgadmin-hackers@postgresql.org; Thu, 21 Jun 2018 21:07:09 +0000 Received: by mail-wm0-x22d.google.com with SMTP id j15-v6so42918wme.0 for ; Thu, 21 Jun 2018 14:07:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pgadmin-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=6yNFlomEdFSxEX4PswqdXHHibta4wG+tyZQb218cCXo=; b=TE7EM63kPL7jBf++WHT1GC3EW61G2upo3VKX8gN1TrIv1npqzuVAxGhYbjo6Js9Pj3 t3COeXyFGf/ZuV1yjKZ8o6GazrKQ/v70PaqeLDnmzw66hWrWIWXTDskT7+P7ykqaZh4I rIGz+eeK5ym3WUub4TkOlxPHekPwtctWDPbggBQICjYdLQYX/tDuoa6Jt+firXUi+Qsk SehK8DzcE94Sbsr9Ai+imPOM1BFrw5jW+IC9i65qWatXyyi1Dy6S+vYSHYBefV8AHmmw JKwp9HEexNZiFE5kJxbQcZ6YXe0Tw/+tTa/Y23JwzHL1LfESSYkzmcIp8NbTFxCDyZi9 7zlA== 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=6yNFlomEdFSxEX4PswqdXHHibta4wG+tyZQb218cCXo=; b=T0ULetOkZ0o8qKolgIFdO6WE+pDpQQc7WqTAjDjV0HM9nWKVlqKk5NFiL+mi+VA8xz t1N3IF3kmnsMYxHmSUmX+P0iWCLQT1pJD9jCPrtQtBkDycKoCwopAOOsGiYwCV8fHH3U byc3rfi8V9+t/hZl+bRB8wd7kwCqjRNgOfHG+2UAXJcNxVGZ2BD87FQhBtT8bxNOrXhv KrmGTlSAqv3EFjMpoGrRMcjy+BTi5nmVTWPLGRJJJejDfa4vcFvL8H92MS+Be5wZI8OA fAMdMi7oHc3CbDUXNeKbUcvRxPEpm3TyDy44nHQtfYmAeDSNjPwdDmUkDOZMdq5EnuZT 5gkg== X-Gm-Message-State: APt69E05wVQ5sR/fCxUcAePyUOT0UZdOSVD+XSdWQgFi1S+1fMFLnnRD I0RYh+XKRIlg82ANRx/OvDfHeRNHjwIqyvlXmyM8jw== X-Google-Smtp-Source: ADUXVKLzd9TYK1zjzfcWfizMXYfVm1W3IA3K/+o+MV3jKC6pzRRkMc4zq4CZ/z6oKc7WcZUhafq6WFS75t+nB1YcNwc= X-Received: by 2002:a1c:b7d4:: with SMTP id h203-v6mr6164967wmf.161.1529615223223; Thu, 21 Jun 2018 14:07:03 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a1c:2907:0:0:0:0:0 with HTTP; Thu, 21 Jun 2018 14:07:02 -0700 (PDT) In-Reply-To: References: From: Dave Page Date: Thu, 21 Jun 2018 22:07:02 +0100 Message-ID: Subject: Re: [pgAdmin4][RM#3289] Can't query SQL_ASCII database. To: Aditya Toshniwal Cc: Joao De Almeida Pereira , pgadmin-hackers Content-Type: multipart/alternative; boundary="0000000000000609d6056f2d4c44" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --0000000000000609d6056f2d4c44 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Thanks, applied. On Thu, Jun 21, 2018 at 4:51 PM, Aditya Toshniwal < aditya.toshniwal@enterprisedb.com> wrote: > Hi Hackers, > > PFA patch to make SQL ASCII related changes compatible with Python 2.6. > Dictionary comprehension is not supported in Python 2.6. > > On Thu, Jun 21, 2018 at 6:27 PM, Dave Page wrote: > >> Thanks - patch applied! >> >> On Wed, Jun 20, 2018 at 3:17 PM, Aditya Toshniwal < >> aditya.toshniwal@enterprisedb.com> wrote: >> >>> Hi Dave, >>> >>> Attached is the updated patch. (Playing with encodings is not at all fu= n >>> :( ) >>> >>> On Tue, Jun 19, 2018 at 2:23 AM, Dave Page wrote: >>> >>>> Hi >>>> >>>> On Mon, Jun 18, 2018 at 2:14 PM, Aditya Toshniwal < >>>> aditya.toshniwal@enterprisedb.com> wrote: >>>> >>>>> Hi Hackers, >>>>> >>>>> Attached is the updated patch which includes the fix for Download CSV >>>>> fail in SQL_ASCII database, which is RM3250 >>>>> >>>>> This should fix RM3289 and RM3250. As they interrelated, sending the >>>>> combined patch. >>>>> Kindly review. >>>>> >>>> >>>> This is definitely looking better - both view and save now work as >>>> expected. However, using the test data the I posted upthread, if I try= to >>>> edit a value (in this case by adding a couple of chars to the end of t= he >>>> data in row 2) I get: >>>> >>> It should fix the error. >>> >>>> >>>> 2018-06-18 16:41:40,895: SQL pgadmin: Execute (void) for server #1 - >>>> DB:ascii (Query-id: 3093186): >>>> UPDATE public.ascii SET >>>> data =3D %(data)s::text WHERE >>>> id =3D '2'; >>>> 2018-06-18 16:41:41,027: INFO werkzeug: 127.0.0.1 - - [18/Jun/2018 >>>> 16:41:41] "POST /sqleditor/save/2805058 HTTP/1.1" 500 - >>>> 2018-06-18 16:41:41,042: ERROR werkzeug: Error on request: >>>> Traceback (most recent call last): >>>> File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages= /werkzeug/serving.py", >>>> line 270, in run_wsgi >>>> execute(self.server.app) >>>> File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages= /werkzeug/serving.py", >>>> line 258, in execute >>>> application_iter =3D app(environ, start_response) >>>> File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages= /flask/app.py", >>>> line 1997, in __call__ >>>> return self.wsgi_app(environ, start_response) >>>> File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages= /flask/app.py", >>>> line 1985, in wsgi_app >>>> response =3D self.handle_exception(e) >>>> File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages= /flask/app.py", >>>> line 1540, in handle_exception >>>> reraise(exc_type, exc_value, tb) >>>> File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages= /flask/app.py", >>>> line 1982, in wsgi_app >>>> response =3D self.full_dispatch_request() >>>> File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages= /flask/app.py", >>>> line 1614, in full_dispatch_request >>>> rv =3D self.handle_user_exception(e) >>>> File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages= /flask/app.py", >>>> line 1517, in handle_user_exception >>>> reraise(exc_type, exc_value, tb) >>>> File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages= /flask/app.py", >>>> line 1612, in full_dispatch_request >>>> rv =3D self.dispatch_request() >>>> File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages= /flask/app.py", >>>> line 1598, in dispatch_request >>>> return self.view_functions[rule.endpoint](**req.view_args) >>>> File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages= /flask_login.py", >>>> line 792, in decorated_view >>>> return func(*args, **kwargs) >>>> File "/Users/dpage/git/pgadmin4/web/pgadmin/tools/sqleditor/__init__= .py", >>>> line 776, in save >>>> default_conn) >>>> File "/Users/dpage/git/pgadmin4/web/pgadmin/tools/sqleditor/command.= py", >>>> line 829, in save >>>> item['sql'], item['data']) >>>> File "/Users/dpage/git/pgadmin4/web/pgadmin/utils/driver/psycopg2/co= nnection.py", >>>> line 975, in execute_void >>>> self.__internal_blocking_execute(cur, query, params) >>>> File "/Users/dpage/git/pgadmin4/web/pgadmin/utils/driver/psycopg2/co= nnection.py", >>>> line 629, in __internal_blocking_execute >>>> cur.execute(query, params) >>>> File "/Users/dpage/git/pgadmin4/web/pgadmin/utils/driver/psycopg2/cu= rsor.py", >>>> line 176, in execute >>>> return _cursor.execute(self, query, params) >>>> UnicodeEncodeError: 'ascii' codec can't encode characters in position >>>> 19-21: ordinal not in range(128) >>>> >>>> >>>>> >>>>> On Fri, Jun 15, 2018 at 2:33 PM, Aditya Toshniwal < >>>>> aditya.toshniwal@enterprisedb.com> wrote: >>>>> >>>>>> Hi Dave, >>>>>> >>>>>> On Fri, Jun 15, 2018 at 2:08 PM, Dave Page wrote= : >>>>>> >>>>>>> Hi >>>>>>> >>>>>>> On Thu, Jun 14, 2018 at 7:05 AM, Aditya Toshniwal < >>>>>>> aditya.toshniwal@enterprisedb.com> wrote: >>>>>>> >>>>>>>> I am sorry I missed the attachment. :( >>>>>>>> PFA. >>>>>>>> >>>>>>> >>>>>>> It looks like the encoding names are getting munged somewhere. I se= e >>>>>>> you've accounted for that to some degree in connection.py (you have= both >>>>>>> SQL_ASCII/MULE_INTERNAL and SQLASCII/MULEINTERNAL), however it does= n't seem >>>>>>> to be enough as I'm getting the following error when trying to down= load CSV >>>>>>> from the query tool. Can we ensure that conn.encoding contains an u= n-munged >>>>>>> value at all times, or is that coming from psycopg2? >>>>>>> >>>>>> =E2=80=8BThat is done by pyscopg2 and conn.encoding is a psycopg2 co= nnection >>>>>> property.=E2=80=8B >>>>>> >>>>>> >>>>>>> >>>>>>> 2018-06-15 09:32:28,799: INFO werkzeug: 127.0.0.1 - - [15/Jun/2018 >>>>>>> 09:32:28] "GET /sqleditor/query_tool/download >>>>>>> /2732923?query=3DSELECT%20*%20FROM%20public.sql_ascii%0AORDER% >>>>>>> 20BY%20id%20ASC%20&filename=3Dsql_ascii.csv HTTP/1.1" 500 - >>>>>>> 2018-06-15 09:32:28,801: ERROR werkzeug: Error on request: >>>>>>> Traceback (most recent call last): >>>>>>> File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packa= ges/werkzeug/serving.py", >>>>>>> line 270, in run_wsgi >>>>>>> execute(self.server.app) >>>>>>> File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packa= ges/werkzeug/serving.py", >>>>>>> line 260, in execute >>>>>>> for data in application_iter: >>>>>>> File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packa= ges/werkzeug/wsgi.py", >>>>>>> line 870, in __next__ >>>>>>> return self._next() >>>>>>> File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packa= ges/werkzeug/wrappers.py", >>>>>>> line 82, in _iter_encoded >>>>>>> for item in iterable: >>>>>>> File "/Users/dpage/git/pgadmin4/web/pgadmin/utils/driver/psycopg2= /connection.py", >>>>>>> line 752, in gen >>>>>>> column_name =3D column_name.decode(conn_encoding) >>>>>>> LookupError: unknown encoding: SQLASCII >>>>>>> >>>>>> >>>>>> =E2=80=8BThis is because there is code bug here. Below is code used = to decode >>>>>> a column name. Connection encoding and python encoding are two diffe= rent >>>>>> things. Python does not know what SQLASCII is. This will work with U= TF-8 >>>>>> because python has decoder with same name. I tried to download CSV w= ith the >>>>>> original code without changes and it fails there too. I will fix thi= s and >>>>>> will send the updated patch. I should have checked this. >>>>>> conn_encoding =3D cur.connection.encoding >>>>>> column_name =3D column_name.decode(conn_encoding)=E2=80=8B >>>>>> >>>>>> >>>>>>> >>>>>>> -- >>>>>>> Dave Page >>>>>>> Blog: http://pgsnake.blogspot.com >>>>>>> Twitter: @pgsnake >>>>>>> >>>>>>> EnterpriseDB UK: http://www.enterprisedb.com >>>>>>> The Enterprise PostgreSQL Company >>>>>>> >>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> Thanks and Regards, >>>>>> Aditya Toshniwal >>>>>> Software Engineer | EnterpriseDB Software Solutions | Pune >>>>>> "Don't Complain about Heat, Plant a tree" >>>>>> >>>>> >>>>> >>>>> >>>>> -- >>>>> 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 >>>> >>> >>> >>> >>> -- >>> 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 >> > > > > -- > Thanks and Regards, > Aditya Toshniwal > Software Engineer | EnterpriseDB Software Solutions | Pune > "Don't Complain about Heat, Plant a tree" > --=20 Dave Page Blog: http://pgsnake.blogspot.com Twitter: @pgsnake EnterpriseDB UK: http://www.enterprisedb.com The Enterprise PostgreSQL Company --0000000000000609d6056f2d4c44 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thanks, applied.

On Thu, Jun 21, 2018 at 4:51 PM, Aditya Toshniwal <aditya.toshniwal@enterprisedb.com> wrote:
<= blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px= #ccc solid;padding-left:1ex">
Hi Hackers,

PFA patch to ma= ke SQL ASCII related changes compatible with Python 2.6. Dictionary compreh= ension is not supported in Python 2.6.

On= Thu, Jun 21, 2018 at 6:27 PM, Dave Page <dpage@pgadmin.org>= wrote:
Thanks - patch a= pplied!

On Wed, Jun 20, 2018 at 3:17 PM, Aditya Toshniwal <aditya= .toshniwal@enterprisedb.com> wrote:
Hi Dave,

Attached is the updated patch. (Pl= aying with encodings is not at all fun :( )

On Tue, Jun 19, 2018 at 2:23 AM, Dave= Page <dpage@pgadmin.org> wrote:
Hi

<= div class=3D"gmail_quote">On Mon, Jun 18, 2018 at 2:14 PM, Aditya Tos= hniwal <aditya.toshniwal@enterprisedb.com> wrote:
Hi Hackers,

Attached is the updated patch which includes the fix f= or Download CSV fail in SQL_ASCII database, which is RM3250=C2=A0
This should fix RM3289 and RM32= 50. As they interrelated, sending the combined patch.
Kindly review.
<= br>
This is definitely looking better - both view and save= now work as expected. However, using the test data the I posted upthread, = if I try to edit a value (in this case by adding a couple of chars to the e= nd of the data in row 2) I get:
=
It should fix the error.=C2=A0<= /span>=C2=A0

2018-06-1= 8 16:41:40,895: SQL pgadmin: Execute (void) for server #1 - DB= :ascii (Query-id: 3093186):
UPDATE public.ascii SET
dat= a =3D %(data)s::text WHERE
id =3D '2';
2018-06-= 18 16:41:41,027: INFO werkzeug:= 127.0.0.1 - - [18/Jun/2018 16:= 41:41] "POST /sqleditor/save/2805058 HTTP/1.1" 500 -
20= 18-06-18 16:41:41,042: ERROR we= rkzeug: Error on request:
=
Traceback (most recent call last):
=C2=A0 File "/= Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/wer= kzeug/serving.py", line 270, in run_wsgi
=C2=A0 =C2=A0 execu= te(self.server.app)
=C2=A0 File "/Users/dpage/.virtua= lenvs/pgadmin4/lib/python2.7/site-packages/werkzeug/serving.py&qu= ot;, line 258, in execute
=C2=A0 =C2=A0 application_iter =3D app(= environ, start_response)
=C2=A0 File "/Users/dpage/.vi= rtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py"= , line 1997, in __call__
=C2=A0 =C2=A0 return self.wsgi_app(envir= on, start_response)
=C2=A0 File "/Users/dpage/.virtualenvs/p= gadmin4/lib/python2.7/site-packages/flask/app.py", line 1985= , in wsgi_app
=C2=A0 =C2=A0 response =3D self.handle_exception(e)=
=C2=A0 File "/Users/dpage/.virtualenvs/pgadmin4/lib/py= thon2.7/site-packages/flask/app.py", line 1540, in handle_excepti= on
=C2=A0 =C2=A0 reraise(exc_type, exc_value, tb)
=C2= =A0 File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-p= ackages/flask/app.py", line 1982, in wsgi_app
=C2=A0 = =C2=A0 response =3D self.full_dispatch_request()
=C2=A0 File &quo= t;/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/= flask/app.py", line 1614, in full_dispatch_request
=C2=A0 = =C2=A0 rv =3D self.handle_user_exception(e)
=C2=A0 File "/Us= ers/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask= /app.py", line 1517, in handle_user_exception
=C2=A0 =C2=A0 = reraise(exc_type, exc_value, tb)
=C2=A0 File "/Users/dpage/.= virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py&quo= t;, line 1612, in full_dispatch_request
=C2=A0 =C2=A0 rv =3D self= .dispatch_request()
=C2=A0 File "/Users/dpage/.virtualenvs/p= gadmin4/lib/python2.7/site-packages/flask/app.py", line 1598= , in dispatch_request
=C2=A0 =C2=A0 return self.view_functions[ru= le.endpoint](**req.view_args)
=C2=A0 File "/Users/dpage= /.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask_login.py= ", line 792, in decorated_view
=C2=A0 =C2=A0 return func(*ar= gs, **kwargs)
=C2=A0 File "/Users/dpage/git/pgadmin4/= web/pgadmin/tools/sqleditor/__init__.py", line 776, in save<= /div>
=C2=A0 =C2=A0 default_conn)
=C2=A0 File "/Users/dp= age/git/pgadmin4/web/pgadmin/tools/sqleditor/command.py", li= ne 829, in save
=C2=A0 =C2=A0 item['sql'], item['data= '])
=C2=A0 File "/Users/dpage/git/pgadmin4/web/pgad= min/utils/driver/psycopg2/connection.py", line 975, in execute_vo= id
=C2=A0 =C2=A0 self.__internal_blocking_execute(cur, query= , params)
=C2=A0 File "/Users/dpage/git/pgadmin4/web/pg= admin/utils/driver/psycopg2/connection.py", line 629, in __intern= al_blocking_execute
=C2=A0 =C2=A0 cur.execute(query, params)
=C2=A0 File "/Users/dpage/git/pgadmin4/web/pgadmin/utils/dr= iver/psycopg2/cursor.py", line 176, in execute
=C2=A0 = =C2=A0 return _cursor.execute(self, query, params)
UnicodeEncodeE= rror: 'ascii' codec can't encode characters in position 19-21: = ordinal not in range(128)
=C2=A0
=

On Fri, Jun 15, 2018 at 2:33 PM, Aditya Toshniwal <aditya.toshniwal@enterprisedb.com> wrote:
Hi Dave,

On Fri, Jun 15, 2018 at 2:08 PM, = Dave Page <dpage@pgadmin.org> wrote:
=
=E2=80=8B= That is done by pyscopg2 and conn.encoding is a psycopg2 connection propert= y.=E2=80=8B
=C2=A0

2018-06-15 09:32:28,799: INFO werkzeug: 127.0.0.1 - - [15/Jun/2018 09:32:28] "GET /sqleditor/qu= ery_tool/download/2732923?query=3DSELECT%20*%20FROM%20public.sql_= ascii%0AORDER%20BY%20id%20ASC%20&filename=3Dsql_ascii.csv HTT= P/1.1" 500 -
2018-06-15 09:32:28,801: ERROR werkzeug: = Error on request:
Traceback (most recent call last):=
=C2=A0 File "/Users/dpage/.virtualenvs/pgadmin4= /lib/python2.7/site-packages/werkzeug/serving.py", line 270, in r= un_wsgi
=C2=A0 =C2=A0 execute(self.server.app)
=C2=A0 F= ile "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packa<= wbr>ges/werkzeug/serving.py", line 260, in execute
=C2=A0 = =C2=A0 for data in application_iter:
=C2=A0 File "/Users/dpa= ge/.virtualenvs/pgadmin4/lib/python2.7/site-packages/werkzeug/wsg= i.py", line 870, in __next__
=C2=A0 =C2=A0 return self._next= ()
=C2=A0 File "/Users/dpage/.virtualenvs/pgadmin4/lib/= python2.7/site-packages/werkzeug/wrappers.py", line 82, in _iter_= encoded
=C2=A0 =C2=A0 for item in iterable:
=C2=A0 File= "/Users/dpage/git/pgadmin4/web/pgadmin/utils/driver/psycopg2/connection.py", line 752, in gen
=C2=A0 =C2=A0 column_name= =3D column_name.decode(conn_encoding)
LookupError: unknown = encoding: SQLASCII
=C2= =A0
=E2=80=8BThis is because there is code bug here. Below is code used = to decode a column name. Connection encoding and python encoding are two di= fferent things. Python does not know what SQLASCII is. This will work with = UTF-8 because python has decoder with same name. I tried to download CSV wi= th the original code without changes and it fails there too. I will fix thi= s and will send the updated patch. I should have checked this.
<= div>
conn_encod= ing =3D cur.connection.encoding

--
Dave PageBlog: http://pg= snake.blogspot.com
Twitter: @pgsnake

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



--
Thanks and Regards,<= div>Aditya Toshniwal
Software Enginee= r |=C2=A0EnterpriseDB Software Solutions |=C2=A0Pune
"Don&#= 39;t Complain about Heat, Plant a tree"



--
<= div>
Thanks and Regards,
Aditya Toshniwal
Software Engineer |=C2=A0EnterpriseDB Software Sol= utions |=C2=A0Pune
"Don't Complain about Heat, Plant a tr= ee"


=

--
Dave Page
B= log: http://pgsna= ke.blogspot.com
Twitter: @pgsnake

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



--
Thanks and Regards,
Aditya Toshniwal
Software Engineer |=C2=A0EnterpriseDB Software Solutions |=C2= =A0Pune
"Don't Complain about Heat, Plant a tree"



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

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Compa= ny



--
=
Thanks and Regards,
= Aditya Toshniwal<= /div>
Software Engineer |= =C2=A0EnterpriseDB Software Solutions |=C2=A0Pune
"Don't = Complain about Heat, Plant a tree"



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

EnterpriseDB UK: http://www.enterprised= b.com
The Enterprise PostgreSQL Company
--0000000000000609d6056f2d4c44--