PostgreSQL server installation

PostgreSQL is a powerful object-relational database system with more than 30 years of active development that has gained a high reputation for reliability, robustness and performance.

PostgreSQL is a powerful object-relational database system with more than 30 years of active development that has gained a high reputation for reliability, robustness and performance.

Install

$ sudo apt install postgresql

After the installation is finished, we verify if the PostgreSQL server is running.

Check status

$ sudo systemctl status postgresql
● postgresql.service - PostgreSQL RDBMS
Loaded: loaded (/lib/systemd/system/postgresql.service; enabled; vendor preset: enabled)
Active: active (exited) since Tue 2019-05-07 21:20:41 EDT; 20min ago
Process: 2620 ExecStart=/bin/true (code = exited, status = 0 / SUCCESS)
Main PID: 2620 (code = exited, status = 0 / SUCCESS)

May 07 21:20:41 debian systemd [1]: Starting PostgreSQL RDBMS ...
May 07 21:20:41 debian systemd [1]: Started PostgreSQL RDBMS.

Connect to the server

$ sudo -u postgres psql
psql (9.6.12)
Type "help" for help.
postgres = #

exit from the Postgres console

\ q

Stop the Postgres server

 $ sudo systemctl stop postgresql 

Start the Postgres server

$ sudo systemctl start postgresql
About the Author

Leave a Reply

%d bloggers like this: