名称 类型 定义 table_schema name 列所在的表的模式(schema)名称 table_name name 列所在的表的名称 column_name name 列的名称 data_type text 列的数据类型 data_type_owner name 数据类型的所有者名称 data_length integer 列的数据长度,对于字符类型使用_pg_char_max_length函数,对于数值类型使用_pg_numeric_precision函数
解决方案: 在同步方式连接时,可以通过主动结束驱动开启的事务。 cursor = conn.cursor() # 增加end语句主动结束驱动开启的事务 cursor.execute("end; select * from test order by 1;") rows = cursor.fetchall() 使用异步连接方式主动开启事务,异步连接介绍具体请参见pyscopg官网。 #!