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 ...
随机推荐
- Objective-C设计模式——中介者Mediator(对象去耦)
中介者模式 中介者模式很好的诠释了迪米特法则,任意两个不相关的对象之间如果需要关联,那么需要通过第三个类来进行.中介者就是把一组对象进行封装,屏蔽了类之间的交互细节,使不同的类直接不需要持有对方引用也 ...
- 轮播图-version1
实现目标 按'>'出现下一caption,按'<'出现上一caption 按下面的点到指定的caption 自动轮播 思路: 设置一个carousel容器,里面有carousel的每一张图 ...
- 【C++】智能指针简述(三):scoped_ptr
在介绍scoped_ptr之前,我们先回顾一下前两篇文章的内容. 首先,智能指针采用RAII机制,通过对象来管理指针,构造对象时,完成资源的初始化;析构对象时,对资源进行清理及汕尾. auto_ptr ...
- iOS显示一张图片 Objective-C
图片文件放在项目目录下 #import "ViewController.h" @interface ViewController () @end @implementation V ...
- Windows sever 2003 IIS6.0 搭建DVWA
DVWA 环境: Windows Sever 2003 IIS 6.0+MYSQL+PHP5.4+FASFCGI 详细教程: http://files.cnblogs.com/files/yyx001 ...
- Caffe RPN:把RPN网络layer添加到caffe基础结构中
在测试MIT Scene Parsing Benchmark (SceneParse150)使用FCN网络时候,遇到Caffe错误. 遇到错误:不可识别的网络层crop 网络层 CreatorRegi ...
- 6.11 将分割数据转换为多值IN列表
问题 已经有了分隔数据,想要将其转换为WHERE子句IN列表中的项目.考虑下面的字符串: 7654,7698,7782,7788 要将该字符串用在WHERE子句中,但是下面的SQL语句是错误的,因为E ...
- PHP下载压缩包文件
PHP 压缩文件需要用到 ZipArchive 类,Windows 环境需要打开 php_zip.dll扩展. 压缩文件 $zip = new ZipArchive(); // 打开一个zip文档,Z ...
- docker搭建日志收集系统EFK
EFK Elasticsearch是一个数据搜索引擎和分布式NoSQL数据库的组合,提过日志的存储和搜索功能. Fluentd是一个消息采集,转化,转发工具,目的是提供中心化的日志服务. Kibana ...
- NOIP 2006 金明的预算方案(洛谷P1064,动态规划递推,01背包变形,滚动数组)
一.题目链接:P1064 金明的预算方案 二.思路 1.一共只有五种情况 @1.不买 @2.只买主件 @3.买主件和附件1(如果不存在附件也要运算,只是这时附件的数据是0,也就是算了对标准的结果也没影 ...