using SQLAlchemy 0.7.3's Inspector, I'm reflecting the columns of a table, and it fails with this trace:
File "./main.py", line 106, in <module>
dbmgr.reflect()
File "./main.py", line 32, in reflect
self.fetch_tables(schema='eg')
File "./main.py", line 58, in fetch_tables
cols0 = self.inspector.get_columns(t, schema=schema)
File "/home/dm/myprojects/Runcible-env/lib/python2.7/site-packages/SQLAlchemy-0.7.3-py2.7-linux-x86_64.egg/sqlalchemy/engine/reflection.py", line 230, in get_columns
**kw)
File "<string>", line 1, in <lambda>
File "/home/dm/myprojects/Runcible-env/lib/python2.7/site-packages/SQLAlchemy-0.7.3-py2.7-linux-x86_64.egg/sqlalchemy/engine/reflection.py", line 46, in cache
ret = fn(self, con, *args, **kw)
File "/home/dm/myprojects/Runcible-env/lib/python2.7/site-packages/SQLAlchemy-0.7.3-py2.7-linux-x86_64.egg/sqlalchemy/dialects/postgresql/base.py", line 1191, in get_columns
rows = c.fetchall()
File "/home/dm/myprojects/Runcible-env/lib/python2.7/site-packages/SQLAlchemy-0.7.3-py2.7-linux-x86_64.egg/sqlalchemy/engine/base.py", line 2985, in fetchall
l = self.process_rows(self._fetchall_impl())
File "/home/dm/myprojects/Runcible-env/lib/python2.7/site-packages/SQLAlchemy-0.7.3-py2.7-linux-x86_64.egg/sqlalchemy/engine/base.py", line 2952, in _fetchall_impl
return self.cursor.fetchall()
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 3: ordinal not in range(128)
I have pinned down the cause to be a column's default value which contains a "ü" character (u umlaut). The query SA emits to get the columns should give for that column:
Running the query from psql prompt, or from a simple script that uses psycopg2 directly, gives no error. So the problem is SA-related.