Https://zh.wikipedia.org/wiki/PostgreSQL
PostgreSQL is a free object-relational database server (database management system), issued under a flexible bsd--style license. It provides a choice for users in addition to other open source database systems such as MySQL and Firebird, and proprietary systems such as Oracle, Sybase, IBM DB2, and Microsoft SQL Server.
PostgreSQL's unusual name causes some readers to stop and try to spell it, especially those who pronounce SQL "sequel". The PostgreSQL developer spelt it "post-gress-q-l". (Audio sample,5.6k MP3). It is also often abbreviated as "Postgres".
In PostgreSQL, programmers can write this logic in any of a sizable set of supported languages.
- The built-in language, called Pl/pgsql, that resembles Oracle's process language, PL/SQL, provides unique advantages when dealing with query-intensive processes.
- Popular scripting languages such as PERL,PYTHON,TCL, and Ruby wrappers, allow the power to take advantage of them in string processing and to connect to a vast external library of functions.
- The high-performance process that requires complex logic to be compiled into machine code can take advantage of C or C + +.
- In more esoteric ways, the processor of the R statistical language allows database queries to take advantage of its rich set of statistical functions.
A programmer can insert code into a server as a function, which is a small wrapper that makes the code resemble a stored procedure. In this way, the SQL code can invoke (for example) C code or vice versa.
- Performance is improved because the database engine invokes all of the logic in one place at a time, reducing the number of round trips between the client and the server.
- Reliability is enhanced because the data validation code is centralized in one place, on the server, without relying on the synchronization logic in multiple customer applications, which may even be written in a variety of programming languages.
- By adding useful abstractions to the server, the customer code can become shorter and simpler.
These advantages combine to confirm that PostgreSQL is the most advanced database system from a programming standpoint. Using PostgreSQL can significantly reduce the overall programming time of many projects, and this advantage grows with the complexity of the project.
Through the function, the command program can be executed on the database server side. Although such instructions can be written using basic SQL statements, the ability to write functions using other programming languages has been introduced in PostgreSQL due to their lack of functionality such as Process control, including:
- A built-in process language named Pl/pgsql, similar to that of Oracle PL/SQL;
- scripting language including PL/PERL,PL/PHP,PL/PYTHON,PL/RUBY,PL/SH,PL/TCL and pl/scheme;
- Compiler language: c,c++, or Java (via Pl/java).
- R Statistical Language (PL/R).
The language of the above section can even be executed within the trigger. PostgreSQL supports row return functions: Their output is a collection of data for a series of row types that can be used as tables in a query. Functions can also be defined to run as either the creator or the caller. In some cases, or in other database products, functions are also referred to as "stored procedures", but technically they are not too different.
What draws my attention is the above-mentioned, has the strong programming ability. The SP was previously written in T-SQL and felt it was very limited in its ability to find a database engine with strong programming capabilities.
Website:
https://www.postgresql.org/
https://www.postgresql.org/download/linux/redhat/
Simple installation command, but the version is not up-to-date:
Yum Install Postgresql-server
If you want to install the latest version, you need to add repo.
https://yum.postgresql.org/repopackages.php
Please note this PostgreSQL YUM repository depends on EPEL repository for some packages. rhel/centos/, etc.
Users should install EPEL repo rpm along with pgdg repo RPMs to satisfy dependencies.
1:epel (Extra Packages for Enterprise Linux)
https://support.rackspace.com/how-to/install-epel-and-additional-repositories-on-centos-and-red-hat/
CentOS and Red Hat Enterprise Linux 6. x
wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpmsudo rpm -Uvh epel-release-6*.rpm
CentOS and Red Hat Enterprise Linux 7. x
wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpmsudo rpm -Uvh epel-release-latest-7*.rpm
2:PGDG Repo
https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-6-x86_64/pgdg-centos96-9.6-3.noarch.rpm
After successful installation, you will find:
/etc/yum.repos.d
There are several files in the catalog:
-rw-r--r--. 1 root root 957 December 15:32 Epel.repo
-rw-r--r--. 1 root root 1056 December 15:32 Epel-testing.repo
-rw-r--r--. 1 root root 1364 December 15:57 Pgdg-96-centos.repo
-rw-r--r--. 1 root root 1012 December 15:45 Pgdg-96-centos.repo.backup
Enter the command:
# Yum Info postgresql96-server
If there is a path error, you need to modify the path separately:
http://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-6.2-x86_64/
The last successful prompt package information indicates that the configuration was successful.
Final execution:
[email protected] yum.repos.d]# yum groupinstall "PostgreSQL Database Server 9.6 pgdg"
...
has been installed:
Postgresql96.x86_64 0:9.6.1-1pgdg.rhel6
Postgresql96-contrib.x86_64 0:9.6.1-1pgdg.rhel6
Postgresql96-libs.x86_64 0:9.6.1-1pgdg.rhel6
Postgresql96-server.x86_64 0:9.6.1-1pgdg.rhel6
Complete!
Indicates that the installation was successful.
CentOS 6 Installation PostgreSQL