python - Python:psycopg2.OperationalError:致命:连接限制
问题描述
如何在我的 python 脚本中解决此错误:
conn=psycopg2.connect(dbname=dbname, host=host, port=port, user=rsuser, password=password)
File "/usr/local/lib/python3.7/site-packages/psycopg2/__init__.py", line 126, in connect
conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
psycopg2.OperationalError: FATAL: connection limit "498" exceeded for non-superusers
我正在连接到 Redshift 数据库,并且我的脚本缺少连接关闭,但现在如何删除连接以便我可以继续?
解决方案
在拨打 Redshift 时遇到了类似的问题。减少批量大小,它对我有用。尝试减少呼叫的批量大小。
推荐阅读
- python - argparse and custom Actions - code path not obvious
- sql - 过滤具有一对多父子映射的表的最有效方法
- sql - Alter Table Column Type 在 Aster 中不起作用 - 我可能搞砸了
- c# - 如何在 C# 中实例化整个 XAML Grid 对象?
- r - 使用 R 从 csv 文件分配树尖标签
- java - 编译器是否违反了范围规则?
- java - 用于多行记录或多行固定宽度文件的平面包 java
- python - pandas dataframe to sql - 将数据附加到现有表而不重复
- sql - 休眠查询不识别 FETCH
- azure-active-directory - Azure AAD 和 Graph API:权限不足,无法完成操作