Re: [pgAdmin4][RM#3289] Can't query SQL_ASCII database. - Mailing list pgadmin-hackers

From Dave Page
Subject Re: [pgAdmin4][RM#3289] Can't query SQL_ASCII database.
Date
Msg-id CA+OCxox-DmkBptAXwiwi_GMCsow0dXzgE2C-wOyMZqGmUd3vCQ@mail.gmail.com
Whole thread Raw
In response to Re: [pgAdmin4][RM#3289] Can't query SQL_ASCII database.  (Aditya Toshniwal <aditya.toshniwal@enterprisedb.com>)
Responses Re: [pgAdmin4][RM#3289] Can't query SQL_ASCII database.  (Aditya Toshniwal <aditya.toshniwal@enterprisedb.com>)
List pgadmin-hackers
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 see you've accounted for that to some degree in connection.py (you have both SQL_ASCII/MULE_INTERNAL and SQLASCII/MULEINTERNAL), however it doesn't seem to be enough as I'm getting the following error when trying to download CSV from the query tool. Can we ensure that conn.encoding contains an un-munged value at all times, or is that coming from psycopg2?

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=SELECT%20*%20FROM%20public.sql_ascii%0AORDER%20BY%20id%20ASC%20&filename=sql_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-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 260, in execute
    for data in application_iter:
  File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/werkzeug/wsgi.py", line 870, in __next__
    return self._next()
  File "/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/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 = column_name.decode(conn_encoding)
LookupError: unknown encoding: SQLASCII

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

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

pgadmin-hackers by date:

Previous
From: Dave Page
Date:
Subject: Re: [pgadmin4][Patch]: Remove extra space from create script for Procedures.
Next
From: Aditya Toshniwal
Date:
Subject: Re: [pgAdmin4][RM#3289] Can't query SQL_ASCII database.