我有一个案例,我与postgres的直接连接工作正常:
conn = psycopg2.connect("dbname='test' host='localhost' port=5435 password='test' user='test'")
cur = conn.cursor()
cur.execute("select * from test")
cur.fetchone()
(1, 100, "abc'def")
但是当我通过sqlalchemy做同样的事情时,我收到以下错误:
engine = sqlalchemy.create_engine('postgresql://test:test@localhost:5435/test')
engine.execute("select * from test")
[...long stack trace...]
ProgrammingError: (psycopg2.ProgrammingError) no results to fetch
我应该检查什么才能找出sqlalchemy无效的内容?