【发布时间】:2019-01-04 05:27:48
【问题描述】:
要在 mysql 中终止带有特定字符串的查询,我可以执行以下操作:
kill_string = 'LONG-QUERY'
cursor = self.conn.cursor()
cursor.execute("SHOW FULL processlist")
for _row in cursor.fetchall():
_id = _row[0]
_query = _row[-1] or ''
if kill_string in _query:
cursor.execute('KILL %s' % _id)
Postgres 中的等价物是什么?
【问题讨论】:
标签: python mysql postgresql