获取 OperationalError: FATAL: 抱歉,已经有太多客户在使用 psycopg2 [英] Getting OperationalError: FATAL: sorry, too many clients already using psycopg2

查看:104
本文介绍了获取 OperationalError: FATAL: 抱歉,已经有太多客户在使用 psycopg2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到错误 OperationalError: FATAL: 抱歉,使用 psycopg2 时已经有太多客户端了.完成后,我在我的连接实例上调用 close 方法.我不确定是什么原因造成的,这是我第一次使用 python 和 postgresql,但我有几年使用 php、asp.net、mysql 和 sql server 的经验.

I am getting the error OperationalError: FATAL: sorry, too many clients already when using psycopg2. I am calling the close method on my connection instance after I am done with it. I am not sure what could be causing this, it is my first experience with python and postgresql, but I have a few years experience with php, asp.net, mysql, and sql server.

我在本地运行它,如果连接像它们应该的那样关闭,那么我一次只打开 1 个连接.我确实有一个对数据库打开的 GUI,但即使关闭我也收到此错误.在我运行我的程序后不久就会发生这种情况.我有一个我调用的函数,它返回一个打开的连接,如:

I am running this locally, if the connections are closing like they should be then I only have 1 connection open at a time. I did have a GUI open to the database but even closed I am getting this error. It is happening very shortly after I run my program. I have a function I call that returns a connection that is opened like:

psycopg2.connect(connectionString)

psycopg2.connect(connectionString)

谢谢

最终这是我的错误,我在错误地递归调用相同的方法,一遍又一遍地打开相同的方法.这是漫长的一天..

Final It was my mistake, I was recursively calling the same method on mistake that was opening the same method over and over. It has been a long day..

推荐答案

这个错误的意思是,连接到 postgreSQL 的客户端太多.你是唯一一个连接到这个数据库的人吗?你在运行图形 IDE 吗?你用什么方法连接?您是否在运行代码的同时测试查询?这些事情中的任何一个都可能是问题所在.如果您是管理员,则可以增加客户端的数量,但是如果某个程序将其挂起,那么这将无济于事.

This error means what it says, there are too many clients connected to postgreSQL. Are you the only one connected to this database? Are you running a graphical IDE? What method are you using to connect? Are you testing queries at the same time that you running the code? any of these things could be the problem. If you are the admin, you can up the number of clients, but if a program is hanging it open, then that won't help for long.

由于您提供给我们的稀疏信息,您可能有太多的客户端同时运行,原因有很多.

There are too many reasons that you could be having too many clients running at the same time with the sparse info that you gave us.

这篇关于获取 OperationalError: FATAL: 抱歉,已经有太多客户在使用 psycopg2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆