admin管理员组文章数量:1025227
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.
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.
本文标签: postgresqlStatement execution not ends in PythonStack Overflow
版权声明:本文标题:postgresql - Statement execution not ends in Python - Stack Overflow 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745614332a2159195.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论