使用客户端工具连接pg,连接失败,报错以下错误:

FATAL: remaining connection slots are reserved for non-replication superuser connections

查看数据库连接状态和配置信息

select * from pg_stat_activity where pid<>pg_backend_pid() and state='idle';##pg_backend_pid()的结果是当前会话的pid
select datname,datconnlimit from pg_database ;
select current_setting('max_connections');
select current_setting('superuser_reserved_connections');

  

发现参数max_connections设置太低。

因为是测试环境,就先把idle状态的连接先杀掉:

##把数据库中的所有的空闲会话全部kill掉
select pg_terminate_backend(pid) from pg_stat_activity where pid<>pg_backend_pid() and state='idle';

然后修改参数max_connections的值。

remaining connection slots are reserved for non-replication superuser connections的更多相关文章

  1. weblogic JDBC Connection Pools--转官方文档

    http://docs.oracle.com/cd/E13222_01/wls/docs81/ConsoleHelp/jdbc_connection_pools.html#1106016 JDBC C ...

  2. Android系统--输入系统(十六)APP跟输入系统建立联系_InputChannel和Connection

    Android系统--输入系统(十六)APP跟输入系统建立联系_InputChannel和Connection 0. 核心:socketpair机制 1. 回顾Dispatch处理过程: 1.1 放入 ...

  3. java.lang.IllegalStateException: Connection pool shut down

    最近使用HttpClient 4.5 使用 CloseableHttpClient 发起连接后,使用CloseableHttpResponse 接受返回结果,结果就报错了,上网查了下,有位stacko ...

  4. SQL Server Connection Pooling (ADO.NET)

    SQL Server Connection Pooling (ADO.NET) Connecting to a database server typically consists of severa ...

  5. Connection Manager简称connman

    ConnMan    Connection Manager简称connman,connman是使用d-bus做为进程间通信机制来管理Linux网络链接的一种软件.在connman的d-bus接口中,有 ...

  6. MySQL基础知识:MySQL Connection和Session

    在connection的生命里,会一直有一个user thread(以及user thread对应的THD)陪伴它. Connection和Session概念 来自Stackoverflow的一个回答 ...

  7. Java性能提示(全)

    http://www.onjava.com/pub/a/onjava/2001/05/30/optimization.htmlComparing the performance of LinkedLi ...

  8. SQLSERVER性能计数器的简单剖析

    SQLSERVER性能计数器的简单剖析 今晚看了这篇文章:SQL Server 2012新performance counter:非常实用的Batch Resp Statistics 文章里介绍到SQ ...

  9. 词频统计_输入到文件_update

    /* 输入文件见337.in.txt 输出文件见338.out.txt */ #include <iostream> #include <cctype> #include &l ...

随机推荐

  1. 【书评:Oracle查询优化改写】第二章

    [书评:Oracle查询优化改写]第二章 BLOG文档结构图 在上一篇中http://blog.itpub.net/26736162/viewspace-1652985/,我们主要分析了一些单表查询的 ...

  2. sklearn.model_selection 的train_test_split方法和参数

    train_test_split是sklearn中用于划分数据集,即将原始数据集划分成测试集和训练集两部分的函数. from sklearn.model_selection import train_ ...

  3. centos7 hadoop 2.8安装

    安装jdk https://www.cnblogs.com/syscn/p/9975049.html 下载hadoop wget http://mirrors.tuna.tsinghua.edu.cn ...

  4. jquery 子元素 后代元素 兄弟元素 相邻元素

    <!DOCTYPE html> <html> <head> <meta http-equiv="Content-type" content ...

  5. shortcuts for contructor 创建对象捷径

  6. Topcoder10566 IncreasingNumber

    IncreasingNumber 一个数是Increasing当且仅当它的十进制表示是不降的,\(1123579\). 求 \(n\) 位不降十进制数中被 \(d\) 整除的有多少个. \(n\leq ...

  7. QPS、TPS、PV、UV、IP

    QPS TPS PV UV IP GMV RPS QPS.TPS.PV.UV.GMV.IP.RPS等各种名词,外行看起来很牛X,实际上每个程序员都是必懂知识点.下面我来一一解释一下. QPS Quer ...

  8. nginx 配置文件正确性测试

    今日思语:每天都要不一样,那么每天就应该多学习 在安装完nginx之后,我们可以使用nginx的测试命令来验证下nginx.conf的配置是否正确: 方式一:不指定文件 nginx -t 如上可知/e ...

  9. 洛谷 P1717 钓鱼 题解

    每日一题 day46 打卡 Analysis 首先通过题目我们不难发现,为了得到最优解,那么就不能把时间浪费在路上,也就是说不能走回头路.然后很容易可以发现,在每个时刻在不同的鱼塘钓到的鱼的数量是不同 ...

  10. (尚019)Vue基于脚手架编写项目

    vue_demo目录结构截图: (1)图一 (2).图二 (3).图三 (四).图四 (5).图五 (6).图六 (7).图七 不能随便改入口文件的名字,因为已经配置好了 (8).图八 (9).图九 ...