How to install PostgreSQL11 on CentOS7

How to install PostgreSQL11 on CentOS7

Install PostgreSQL 11 on CentOS 7

PostgreSQL: The World's Most Advanced Open Source Relational Database

In order to learn about the world's most advanced open source relational database, you must first install it. Next, install PostgreSQL 11 on CentOS 7.

environment

Alibaba Cloud CentOS 7.3.1611

PostgreSQL 11

PostgreSQL

PostgreSQL is an object-relational database management system (ORDBMS) based on POSTGRES, which was developed by the Department of Computer Science at the University of California, Berkeley and has now been renamed PostgreSQL, version 4.2. PostgreSQL supports most of the SQL standard and provides many other modern features: complex queries, foreign keys, triggers, views, transactional integrity, MVCC. Likewise, PostgreSQL can be extended in many ways, for example, by adding new data types, functions, operators, aggregate functions, and indexes. PostgreSQL is free to use, modify, and distribute for private, commercial, and academic research purposes.

PostgreSQL has had a built-in JSON data type since version 9.3, and JSONB support since version 9.4, indicating that PostgreSQL is actually a combination of a relational database and a NoSQL database. Although PostgreSQL is still positioned as a relational database, in recent updates, PostgreSQL's NoSQL performance has soared and even surpassed MongoDB.

PostgreSQL Installation

Here we install PostgreSQL 11 in rpm mode

# Download rpm package yum install https://download.postgresql.org/pub/repos/yum/11/redhat/rhel-7-x86_64/pgdg-redhat11-11-2.noarch.rpm -y

# Install yum -y install postgresql11 postgresql11-server postgresql11-libs

# Initialize the database /usr/pgsql-11/bin/postgresql-11-setup initdb

# Set PostgreSQL to start automatically at boot and start the service systemctl enable postgresql-11
systemctl start postgresql-11
systemctl status postgresql-11
## If you see the word "Running" after "Active" in the console output, it means the startup is complete.

PostgreSQL Connection

# Log in to the database, switch account postgres here
su - postgres
psql

# Navicat connects to PostgreSQL
# Here we need to modify the configuration file postgresql.conf
find / -name postgresql.conf
vi /var/lib/pgsql/11/data/postgresql.conf

# Find listen_address, uncomment it and change the value of localhost in quotes to *
listen_address="*"

# Save and exit, restart the postgresql service systemctl restart postgresql-11

# Alibaba Cloud Security Group Rule Configuration -> Quickly Add Security Group Rules -> Select PostgreSQL and add # In Navicat, if you do not change localhost to *, Navicat will prompt an error "Connection Refuse" when connecting.

# I changed the password of the postgres user here, the steps are as follows:
## Switch user and enter psql
su - postgres
psql
## Change password alter user postgres password 'password' 

Connection successful!

At this point, PostgreSQL is set up. Setting up PostgreSQL on Windows is relatively simple. Next, learn PostgreSQL!

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

You may also be interested in:
  • How to get the current date and time in PostgreSQL and precautions
  • PostgreSQL tree structure recursive query example
  • Syntax and usage of window functions in PostgreSQL database
  • How to implement batch insert, update and merge operations in PostgreSQL
  • PostgreSQL stored procedure usage practical explanation
  • Example code for resetting PostgreSQL password on Mac

<<:  jQuery plugin to implement minesweeper game (1)

>>:  MySQL uninstall and install graphic tutorial under Linux

Recommend

Linux Basic Tutorial: Special Permissions SUID, SGID and SBIT

Preface For file or directory permissions in Linu...

MySQL isolation level detailed explanation and examples

Table of contents 4 isolation levels of MySQL Cre...

Solve the problem of Tomcat10 Catalina log garbled characters

Running environment, Idea2020 version, Tomcat10, ...

Example of how rem is adapted for mobile devices

Preface Review and summary of mobile terminal rem...

How to set PATH environment variable in Linux system (3 methods)

1. In Windows system, many software installations...

WeChat applet realizes linkage menu

Recently, in order to realize the course design, ...

Examples of common Nginx misconfigurations

Table of contents Missing root location Off-By-Sl...

How to Customize Bash Command Prompt in Linux

Preface As we all know, bash (the B ourne-A gain ...

Vue scroll down to load more data scroll case detailed explanation

vue-infinite-scroll Install npm install vue-infin...

What are the advantages of using B+ tree index in MySQL?

Before understanding this problem, let's firs...

CentOS 8 officially released based on Red Hat Enterprise Linux 8

The CentOS Project, a 100% compatible rebuild of ...