psycopg2设置语句执行时间超时
原文
https://stackoverflow.com/questions/19963954/set-transaction-query-timeout-in-psycopg2
设置方式
1.代码中添加options
1 | >>> import psycopg2 |
2.添加到系统环境变量中(PGOPTIONS)
1 | >>> import os |
相关文章参考
https://blog.crunchydata.com/blog/control-runaway-postgres-queries-with-statement-timeout
https://iotespresso.com/how-to-configure-statement-timeout-in-psycopg2/

作者:
胖胖不胖
版权声明:
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 不止于python
感谢您的支持,我会继续努力!
微信支付
支付宝