我尝试在Python应用程序中连接Postgres数据库。 我使用psycopg2库。在
如果我像这样执行select语句:
cursor.execute("""select schema_name from information_schema.schemata;""")
rows = cursor.fetchall()
print(rows)
我得到:
^{pr2}$但如果我执行语句
cursor.execute("""select * from DB_FZ.d_results;""")
rows = cursor.fetchall()
print(rows)
我搞错了
psycopg2.ProgrammingError: schema "db_fz" does not exist
LINE 1: select * from DB_FZ.d_results;
怎么了?在
架构名称是大写的,应该用双引号括起来:
另请参见Are PostgreSQL column names case-sensitive?
相关问题 更多 >
编程相关推荐