Re: [pgAdmin4][RM#3289] Can't query SQL_ASCII database.
От | Dave Page |
---|---|
Тема | Re: [pgAdmin4][RM#3289] Can't query SQL_ASCII database. |
Дата | |
Msg-id | CA+OCxozRjJY6RWrXpMLD6-dWnm2LdPs6bS+VmJa403vxVoLwhg@mail.gmail.com обсуждение исходный текст |
Ответ на | [pgAdmin4][RM#3289] Can't query SQL_ASCII database. (Aditya Toshniwal <aditya.toshniwal@enterprisedb.com>) |
Ответы |
Re: [pgAdmin4][RM#3289] Can't query SQL_ASCII database.
|
Список | pgadmin-hackers |
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 <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 windows.Sample insert - insert into test_tab values ('é');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 instead of ascii. I tried setting the client_encoding using set_client_encoding('UTF8') method of a psycopg2 connection but no luck (also its not allowed for async connection). I also tried executing "SET CLIENT_ENCODING='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 milestonesAlso fixed a small glitch for sql editor connection status check.Kindly review.Thanks and Regards,Aditya ToshniwalSoftware 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
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
В списке pgadmin-hackers по дате отправления: