2 instances of postgresql but I really need one [closed]
I happen to have 2 installed instances of postgresql at my machine: 9.1 and 9.2:
sudo service postgresql status
9.1/main (port 5432): down
9.2/main (port 5433): down
They are located at /etc/postgresql/9.1/ and /etc/postgresql/9.2/. Then I run 9.2 by saying sudo service postgresql start
But this command fails:
$ psql
psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
I really want to use 9.2 only, I don't need 2 instances.
Do you have any idea of how to either remove 9.1 safely or make 9.2 to be the main, default instance?
-------------------------------------------------------------------------------------------------------
This situation with two clusters in Ubuntu may happen when upgrading to a newer release providing an newer postgresql version.
The automatic upgrade does not remove the old cluster, presumably for fear of erasing valuable data (which is wise because some postgres upgrades may require human work to be complete).
If you know you want to drop it, just run:
sudo pg_dropcluster --stop 9.1 main
The corresponding data directory will be removed and service postgresql will no longer refer to 9.1
At this point the 9.2 cluster will still use the port 5433, which is unpractical.
To switch it to the default port, edit /etc/postgresql/9.2/main/postgresql.conf and change the line port = 5433 to port = 5432
Then restart PostgreSQL.
Finally to get rid of the postgresql-9.1 packages see the result of dpkg -l 'postgresql*9.1*'
2 instances of postgresql but I really need one [closed]的更多相关文章
- 解决postgresql -- ERROR: 42601: query has no destination for result data
I am learning Npgsql and PostgreSQL. I am unable to define the output parameter correctly. What am I ...
- PostgreSQL configuration file postgresql.conf recommanded settings and how it works
1 Set max_connections to three times the number of processor cores on the server. Include vir ...
- LINQ to PostgreSQL Tutorial
原文 LINQ to PostgreSQL Tutorial This tutorial guides you through the process of creating a simple app ...
- Java向PostgreSQL发送prepared statement 与 libpq 向PostgreSQL发送prepared statement之比较:
Java 代码,在数据库端,并没有当成 prepared statetment 被处理. C代码通过libpq 访问数据库端,被当成了 prepared statement 处理.也许是因Postgr ...
- PostgreSQL Q&A: Building an Enterprise-Grade PostgreSQL Setup Using Open Source Tools
转自:https://www.percona.com/blog/2018/10/19/postgresql-building-enterprise-grade-setup-with-open-sour ...
- 【转帖】如何在redhat单机服务器上运行postgresql的多个实例(howto run multiple postgresql instance on one redhat server)
Running multiple PostgreSQL 9.2 Instances on one server in CentOS 6/RHEL 6/Fedora 原帖网站速度很慢,故转帖在此 Thi ...
- postgreSQL PL/SQL编程学习笔记(六)——杂七杂八
1 PL/pgSQL Under the Hood This part discusses some implementation details that are frequently import ...
- 云原生 PostgreSQL - CrunchyData PGO 教程:创建、连接、删除 Postgres 集群
入门 作为安装的一部分,请确保您已完成以下操作: 分叉 Postgres Operator 示例存储库并将其克隆到您的主机. https://github.com/CrunchyData/postgr ...
- postgresql 基本语法
postgresql数据库创建/修改/删除等写入类代码语法总结: 1,创建库 2,创建/删除表 2.1 创建表 create table myTableName 2.2 如果表不存在则创建表 crea ...
随机推荐
- 构建一个.net的干货类库,以便于快速的开发 - 前言
前言: 工作已经快两年了,项目也做过不少,不知道大家有没有一个习惯,就是把在做项目过程中那些好的方法记录下来.我觉得这个习惯在开发的过程中还是很有用的,举个例子,我之前做过一个支付宝的支付功能,然后把 ...
- 17 C#中的循环执行 while循环
在编程中有代码的执行主要有三种方式.(1)顺序执行,也就是一条语句一条语句按顺序执行:(2)条件执行,也就是if...else.当某种条件满足时执行一些代码:(3)循环执行,就是当某种条件满足的时候, ...
- 数据采集框架Gobblin简介
问题导读: Gobblin的架构设计是怎样的? Gobblin拥有哪些组建,如何实现可扩展? Gobblin采集执行流程的过程? 前面我们介绍Gobblin是用来整合各种数据源的通用型ETL框架,在某 ...
- 数据库学习:for xml path
一.开发环境 数据库:SQLServer2012 二.语法简介 for xml path它以xml形式展示查询的结果集 三.语法介绍 现在数据库中有一张表 1.基本语法 select * from B ...
- linux 常用shell命令 ls
ls:查看文件名和目录,用法:$ ls [选项] 1. $ ls 直接输入ls命令,则列出当前目录下的所有文件和目录,不显示详细信息,如类型,大小,日期权限等. 2. $ ls -l -l 选项,每行 ...
- 多路开关模式的switch语句
在实例10中,将break语句去掉之后,会将符合检验条件后的所有语句都输出.利用这个特点,可以设计多路开关模式的switch语句,例如:在平年一年12个月,1.3.5.7.8.10.12月是31天,4 ...
- strong,weak, retain, assign的区别@property的参数
strong,weak, retain, assign的区别@property的参数 先说经验 使用场合 copy:NSString,block, weak:UI控件,代理 strong:一般对象.自 ...
- Linux 学习(二)
Linux相关命令 命令 说明 startx 当前用户界面切换至图形界面 init5 切换至另一用户的图形化界面 init3 从图形界面切换回文本界面 pwd 显示当前用户路径 logout 注销 s ...
- linux nohup & 简单使用
线上通常nohup配合&启动程序,同时免疫SIGINT和SIGHUP信号,从而保证程序在后台稳定运行 & 1.后台运行,输出默认到屏幕 2.免疫SIGINT信号,比如Ctrl+c不会杀 ...
- Windows提高_1.1内核对象
内核对象 什么是内核对象? 内核对象本质上是一个结构体,我们不能直接的操作一个内核对象,需要通过操作系统提供的一系列函数和我们使用的内核对象句柄对它进行一系列的修改. 如何操作内核对象? 创建一个内核 ...