postgresql - Statement execution not ends in Python - Stack Overflow

When running the below statement that takes more than 30 minutes (31 minutes) using psycopg2 the execut

When running the below statement that takes more than 30 minutes (31 minutes) using psycopg2 the execution ends in the PostgreSQL server but the python routine not ends:

do $$
declare
  v_minutes int := 31;
begin

  perform pg_sleep(60 * v_minutes);

end $$;
print("start of execution")
try:
    cur  = conn.cursor()
    cur.execute(statement)
finally:
    if cur:
        cur.close()
print("end of execution")

In the PostgreSQL logs I got at 30 minutes of execution: "could not receive data from client: connection reset by peer"

If I run the statement with 29 minutes for example... it works ok.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745614334a4636139.html

相关推荐

  • postgresql - Statement execution not ends in Python - Stack Overflow

    When running the below statement that takes more than 30 minutes (31 minutes) using psycopg2 the execut

    9小时前
    40

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信