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

Mini Program to Implement Sieve Lottery

This article example shares the specific code of ...

Vue implements tree table through element tree control

Table of contents Implementation effect diagram I...

Django online deployment method of Apache

environment: 1. Windows Server 2016 Datacenter 64...

Summary of new usage of vi (vim) under Linux

I have used the vi editor for several years, but ...

About vue component switching, dynamic components, component caching

Table of contents 1. Component switching method M...

How to introduce img images into Vue pages

When we learn HTML, the image tag <img> int...

Apply provide and inject to refresh Vue page method

Table of contents Method 1: Call the function dir...

Commands to find domain IP address in Linux terminal (five methods)

This tutorial explains how to verify the IP addre...

How to use docker to build redis master-slave

1. Build a Docker environment 1. Create a Dockerf...

How to monitor array changes in JavaScript

Preface When introducing defineProperty before, I...

Html Select uses the selected attribute to set the default selection

Adding the attribute selected = "selected&quo...

Border-radius IE8 compatible processing method

According to canisue (http://caniuse.com/#search=...

How to remove the dividing line of a web page table

<br />How to remove the dividing lines of a ...