How to install and configure the PostgreSQL server in Ubuntu. This is an open-source relational database management system and it’s designed to handle workloads, from a single machine to data warehouses. In a similar way, we can configure and install PostgreSQL on Linux as well as ubuntu.
We don’t need to add any repository to install the database. we have to update the packages and simply run the below commands to get installed.
if you want to update the machine before installing the PostgreSQL, you can use sudo apt update command.
Install the PostgreSQL using apt install postgresql postgresql-contrib postgresql-client-common
The service will start automatically we can check using netstat -tnlp
The PostgreSQL must be listening on port 5432. s
We can check the version installed using apt show postgresql
sudo -u postgres psql -c "SELECT version();"
We can also check the service running with service postgresql status so
By default, user postgres will be created on the machine and we can log in using the below commands. so
su - postgres psql
you can exit using \q and check the database using \l
Check user using \du so