psycopg2无法截断postgres表

时间:2019-11-22 20:05:57

标签: python postgresql psycopg2

我有一个python代码,试图截断一个postgres表。这是执行此操作的方法:

def truncate(self, tablename):
        curs = self.conn.cursor()
        curs.execute("TRUNCATE TABLE %s" % tablename)
        curs.close()
        self.conn.commit()
        return

为什么程序流到达此方法时会卡住?卡住是指控件进入此方法,但不会出现或引发异常。只是停止了。

0 个答案:

没有答案
相关问题