如何解决FATAL:非超级用户超出连接限制 [英] How to resolve FATAL: connection limit exceeded for non-superusers

查看:1586
本文介绍了如何解决FATAL:非超级用户超出连接限制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经编写了一个用于批量插入的java代码。我正在使用copy命令为不同的表导入和创建不同的连接对象,但在执行时,程序会抛出以下错误:

I have written a java code for bulk insertion. I'm using the copy command for importing and creating different connection objects for different tables, but while executing, the program it is throwing the following errors:

FATAL: connection limit exceeded for non-superusers


推荐答案

您已超出PostgreSQL服务器的连接限制。超级用户有一些保留的连接。

You have exceeded the connection limit of PostgreSQL server. There are some reserved connection for Super user.

要增加连接限制,你必须更改postgresql.conf(默认为100)
它位于你的PostgreSQL数据目录。

To increase the connection limit you have to change the postgresql.conf (default 100) it is located on your PostgreSQL data directory.

cat postgresql.conf | grep max_connection max_connections = 100
        # (change requires restart)
# Note:  Increasing max_connections costs ~400 bytes of shared memory per
# max_locks_per_transaction * (max_connections + max_prepared_transactions)

增加限制并重新启动PostgreSQL实例。

Increase the limit and restart the PostgreSQL instance.

警告:增加连接限制将影响内存。

Warning: increasing the connection limit will affect the memory.

尝试使用应用程序或数据库层中的连接池优化连接。在PostgreSQL上
你可以使用 Pgpool2

try optimizing connection using connection pooling either in application or db layer. on PostgreSQL you can use Pgpool2.

这篇关于如何解决FATAL:非超级用户超出连接限制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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