It’s an open-source Postgresql (database) tool

Step1. Download the source file

wget https://ftp.postgresql.org/pub/source/v10.10/postgresql-10.10.tar.gz

Step2. Create the Postgres user and set a password.

useradd postgres
password postgres

Step3. Create the Postgres installation directory

mkdir -p /opt/PostgreSQL/10.10

Step4. Extract the file and compile it

tar xvf postgresql-10.10.tar.gz
cd postgresql-10.10
./configure --prefix=/opt/PostgreSQL/10.10 --without-readline --without-zlib
make && make install
cd contrib/
make && make install

Step5. Set the permission

chown postgres:postgres /opt/PostgreSQL -R

Step6. Create the datadir and change the permission.

mkdir /data
chown postgres:postgres /data

Step7. Initialize the datadir

su - postgres
/opt/PostgreSQL/10.10/bin/initdb -D  /data/

Step8. Start database

/opt/PostgreSQL/10.10/bin/pg_ctl -D /data -l logfile start

Step9. Login in database

/opt/PostgreSQL/10.10/bin/psql -U postgres
postgres=# \l+

LEAVE A REPLY

Please enter your comment!
Please enter your name here