You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there an explicit encoding requirement that I need to set? Thanks
cur.execute("""CREATE DATABASE IF NOT EXISTS TEST""")
*** SystemError: decoding with 'cp1252' codec failed (SystemError: returned a result with an error set)
The text was updated successfully, but these errors were encountered:
The above causes an error because "create database if not exists" doesn't exist.
In [11]: cnn.set_client_encoding('win1252')
In [12]: cur.execute("create database if not exists asdf ")
---------------------------------------------------------------------------
ProgrammingError Traceback (most recent call last)
<ipython-input-12-8557d908ff45> in <module>()
----> 1 cur.execute("create database if not exists asdf ")
ProgrammingError: syntax error at or near "not"
LINE 1: create database if not exists asdf
^
I believe this message gets localized in a locale that has chars not supported in cp1252, which postgres emits anyway but python then barfs trying to decode, in a codepath that doesn't handle the exception properly. I should make myself a Japanese database to play with...
However if you say that postgres is in English for you, then my theory doesn't work here because, as you see above there is no problem receiving the exception in English.
Is there an explicit encoding requirement that I need to set? Thanks
cur.execute("""CREATE DATABASE IF NOT EXISTS TEST""")
*** SystemError: decoding with 'cp1252' codec failed (SystemError: returned a result with an error set)
The text was updated successfully, but these errors were encountered: