Install PostgreSQL 11 on Amazon EC2
In this, we will show you How to install PostgreSQL 11 on Amazon EC2. You will see how to Install PostgreSQL 11 on Amazon Linux is very easy and quick to install and use.
Before installing here is a short description of PostgreSQL
PostgreSQL is a powerful, open source object-relational database system. It has more than 15 years of active development and a proven architecture that has earned it a strong reputation for reliability, data integrity, and correctness. It runs on all major operating systems, including Linux, UNIX (AIX, BSD, HP-UX, SGI IRIX, Mac OS X, Solaris, Tru64), and Windows. It is fully ACID compliant, has full support for foreign keys, joins, views, triggers, and stored procedures (in multiple languages). It includes most SQL:2008 data types, including INTEGER, NUMERIC, BOOLEAN, CHAR, VARCHAR, DATE, INTERVAL, and TIMESTAMP. It also supports storage of binary large objects, including pictures, sounds, or video. It has native programming interfaces for C/C++, Java, .Net, Perl, Python, Ruby, Tcl, ODBC, among others, and exceptional documentation.
1. Add PGDG Repo
Firstly we need to add the pgdg repository in Amazon Linux
yum install https://download.postgresql.org/pub/repos/yum/11/redhat/rhel-7-x86_64/pgdg-centos11-11-2.noarch.rpm
Now we need to change the release server to redhat so we can use this repository.
sed -i "s/rhel-\$releasever-\$basearch/rhel-7.5-x86_64/g" "/etc/yum.repos.d/pgdg-11-centos.repo"
2. Install Postgresql 11
To install PostgreSQL us the following command. It will install complete postgreSQL Database group.
yum groupinstall "PostgreSQL Database Server 11 PGDG"
Create a new PostgreSQL database cluster
Initializing database ... OK
3. Restart the services of postgresql
Now execute the following command to start and enable the postgresql services.
systemctl enable postgresql-11
systemctl start postgresql-11
You might also like: How to install postgresql 9.6 on Mac
PostgreSQL installation is done. If you want to use the postgreSQL log in postgres account by typing following command
su - postgres
You can get into Postgres console by typing
Now use the postgresql as you want to use. To get the help use the \h command.
Read Also: Useful s3 commands
If you have any problem using this tutorial feel free to comment.