CentOS install PostgreSQL 9.1

PostgreSQL is usually referred to as Postgres. It is a relational database management system, suitable for various Linux operating systems, Windows, Solaris, BSD and Mac OS X. PostgreSQL is an open source software under the PostgreSQL license. PostgreSQL is developed by the PostgreSQL Global Development Group, and is composed and supervised by a very small number of companies, such as Red Hat and EnterpriseDB.

PostgreSQL's popularity is getting bigger and bigger, and this is a matter of course: it is so reliable and efficient. Compared with traditional enterprise-level relational databases, PostgreSQL is completely based on community-driven, with rich tools and documents, and forms a complete ecosystem.

The following is the process of installing PostgreSQL 9.1 on CentOS:

  1. Add PosgreSQL Yum Repository, visit http://yum.pgrpms.org/reporpms/repoview/letter_p.group.html, download and install the rpm file corresponding to the current system.

[ root@SNDA-192-168-15-161 src]# wget http://yum.pgrpms.org/9.1/redhat/rhel-6-x86_64/pgdg-centos91-9.1-4.noarch.rpm

100 %[======================================>] 5,124       18.7K/s   in 0.3s

2012- 08- 25 16:56:19 (18.7 KB/s) - “pgdg-centos91-9.1-4.noarch.rpmâ€

[ root@SNDA-192-168-15-161 src]# ls -l
total 17644
drwxr-xr-x  9 1001 1001     4096 Aug 18 19:47 nginx-1.2.1

Modify the original yum warehouse configuration, add exclude=postgresql* at the end of the [base] and [updates] sections to cancel the installation and update of PostgreSQL from the default warehouse.
[ root@SNDA-192-168-15-161 src]# cd /etc/yum.repos.d
[ root@SNDA-192-168-15-161 yum.repos.d]# vi CentOS-Base.repo

Install or upgrade postgresql-libs
[ root@SNDA-192-168-15-161 yum.repos.d]# yum upgrade postgresql-libs
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile

Install PostgreSQL Server
[ root@SNDA-192-168-15-161 yum.repos.d]# yum install postgresql91-server
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile

Dependencies Resolved

================================================================================
Package                  Arch        Version                 Repository   Size

Installing:
postgresql91-server      x86_64      9.1.5-1PGDG.rhel6       pgdg91      3.6 M
Installing for dependencies:
postgresql91             x86_64      9.1.5-1PGDG.rhel6       pgdg91      990 k
postgresql91-libs        x86_64      9.1.5-1PGDG.rhel6       pgdg91      188 k

Transaction Summary

Install       3 Package(s)

Total download size: 4.7 M
Installed size: 20 M
Is this ok [y/N]: y
Downloading Packages:
(1 /3): postgresql91-9.1.5-1PGDG.rhel6.x86_64.rpm         | 990 kB     00:06
(2 /3): postgresql91-libs-9.1.5-1PGDG.rhel6.x86_64.rpm    | 188 kB     00:02
(3 /3): postgresql91-server-9.1.5-1PGDG.rhel6.x86_64.rpm  | 3.6 MB     00:43

Total                                            90 kB/s | 4.7 MB     00:54
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
  Installing : postgresql91-libs-9.1.5-1PGDG.rhel6.x86_64                   1/3
  Installing : postgresql91-9.1.5-1PGDG.rhel6.x86_64                        2/3
  Installing : postgresql91-server-9.1.5-1PGDG.rhel6.x86_64                 3/3
  Verifying  : postgresql91-libs-9.1.5-1PGDG.rhel6.x86_64                   1/3
  Verifying  : postgresql91-server-9.1.5-1PGDG.rhel6.x86_64                 2/3
  Verifying  : postgresql91-9.1.5-1PGDG.rhel6.x86_64                        3/3

Installed:
  postgresql91-server.x86_64 0:9.1.5-1PGDG.rhel6

Dependency Installed:
  postgresql91.x86_64 0:9.1.5-1PGDG.rhel6
  postgresql91-libs.x86_64 0:9.1.5-1PGDG.rhel6

Complete!

Initialize the database, the default path is /var/lib/pgsql/9.1/data
[ root@SNDA-192-168-15-161 yum.repos.d]# service postgresql-9.1 initdb
Initializing database:                                     [  OK  ]

Start service
[ root@SNDA-192-168-15-161 yum.repos.d]# service postgresql-9.1 start
Starting postgresql-9.1 service:                           [  OK  ]

[ root@SNDA-192-168-15-161 yum.repos.d]# vi /var/lib/pgsql/9.1/data/pg_hba.conf
[ root@SNDA-192-168-15-161 yum.repos.d]# psql -U postgres
psql: FATAL:  Peer authentication failed for user "postgres"

Restart service
[ root@SNDA-192-168-15-161 yum.repos.d]# service postgresql-9.1 restart
Stopping postgresql-9.1 service:                           [  OK  ]
Starting postgresql-9.1 service:                           [  OK  ]

( Here you need to modify the configuration file /var/lib/pgsql/9.1/data/pg_hba.conf first to change the peer or other to trust, otherwise it will prompt the error Peer authentication failed for user “postgres”), modify the client authentication configuration file, Change METHOD from the default ident to md5
[ root@SNDA-192-168-15-161 yum.repos.d]# psql -U postgres
psql (9.1.5)
Type "help" for help.

postgres=# ALTER USER postgres WITH PASSWORD 'admin'
postgres-# \q

Engine Yard: PostgreSQL is our first choice

PostgreSQL interface programming 2: .NetDataProvider-Npgsql driver

http://blog.csdn.net/beiigang/article/details/7051625

http://www.codeproject.com/Articles/30989/Using-PostgreSQL-in-your-C-NET-application-An-intr

http://datachomp.com/archives/getting-started-with-postgres-and-mvc3/

http://www.pgadmin.org/

Recommended Posts

CentOS install PostgreSQL 9.1
Centos 7 install PostgreSQL
Install PostgreSQL12 under CentOS7
1.5 Install Centos7
Centos6 install Python2.7.13
Centos7.3 install nginx
CentOS install Redmine
Centos7 install Python 3.6.
CentOS7 install MySQL
Centos7 install protobuf
CentOS7 install GlusterFS
CentOS 7.4 install Zabbix 3.4
Centos6.5 install Tomcat
CentOS install Python 3.6
Vmware install CentOS6
centos7 install docker-ce 18.01.0
CentOS 7.2 install MariaDB
CentOS 7 install Hadoop 3.0.0
Centos7 install Python2.7
Centos 7.6 install seleniu
CentOS 7.3 install Zabbix3
Centos7 install LAMP+PHPmyadmin
CentOS install mysql
CentOS install openjdk 1.8
CENTOS6.5 install CDH5.12.1 (1)
CentOS install PHP
CentOS6 install mist.io
Centos7 install Docker
CentOS7 install mysql
centOs install rabbitMQ
CentOS 7 install MySQL 5.6
Centos7 install Nginx
Centos7 install docker18
How to install Postgresql on CentOS 8
Centos install Python3
centos7 install docker
CentOS install jdk
centos7 install nginx-rtmp
CentOS8 install MySQL8.0
Centos6.3 install KVM
CentOS7 install mysql8
CentOS 7 install Java 1.8
CentOS8 install fastdfs6.06
CentOS 7 install Gitlab
CentOS7 install MySQL8
CentOS 7 install Java 1.8
CentOS 6 install Docker
centos 6.5 install zabbix 4.4
Centos8 install Docker
CentOS6.8 install python2.7
CentOS install nodejs 8
CentOS6.5 install GNS3
centos 7.5 install mysql5.7.17
Centos7 install MySQL8.0-manual
CentOS7 install Kubernetes 1.16.3
VirtualBox install centos7
centos7 install lamp
Install centos7 and connect
Centos7 install docker-18.x original
Centos7 YUM install MariaDB 10.0
CentOS 8 install ZABBIX4.4 guide