PostgreSQL (aka Postgres) is an open-source object-relational database management system (ORDBMS), developed by PostgreSQL Global Development Group, a group of individual volunteers and corporate companies.
karan@ubuntu:$ dpkg -l grep postgres ii pgdg-keyring 2018.2 all keyring for apt.postgresql.org ii postgresql-10 10.7-1.pgdg18.04+1 amd64 object-relational SQL database, version 10 server ii.
PostgreSQL is available for Linux, Microsoft Windows, FreeBSD, OpenBSD, Solaris, and Mac OS. Here, we will see how to install PostgreSQL on Ubuntu 20.04. Add PostgreSQL repository. PostgreSQL is available from both Ubuntu (sudo apt update && sudo apt install -y postgresql) and PostgreSQL’s repository.
Install Postbird on Ubuntu. Download Postbird DEB package. And then install it using command: sudo dpkg -i Postbird0.8.2amd64.deb C. Navicat for PostgreSQL. Navicat is a well-known database client software. The Navicat for PostgreSQL is a powerful and easy to use GUI Client for PostgreSQL.
Postgres Enterprise Manager from EnterpriseDB is probably the most advanced you'll find. It includes all the features of pgAdmin, plus monitoring of your hosts and database servers, predictive reporting, alerting and a SQL Profiler.
PostgreSQL is available for Linux, Microsoft Windows, FreeBSD, OpenBSD, Solaris, and Mac OS.
Here, we will see how to install PostgreSQL on Ubuntu 20.04.
Add PostgreSQL repository
PostgreSQL is available from both Ubuntu (sudo apt update && sudo apt install -y postgresqlDiscobrick pro 2 16. ) and PostgreSQL’s repository.
PostgreSQL’s repository packages are fresher than those available in the Ubuntu repository. So, here we will install PostgreSQL from the PostgreSQL’s repository.
Import the PostgreSQL’s signing key.
Add the PostgreSQL repository information to postgresql.list file.
Install PostgreSQL
Execute the below command to update the repository index.
Installing PostgreSQL in Ubuntu 20.04. Log into your Ubuntu system and update the system software packages using the following apt command. $ sudo apt update Now install the latest version of PostgreSQL from the default Ubuntu repositories. $ sudo apt install postgresql.
Install the PostgreSQL package using the apt command.
By default, the PostgreSQL service is started automatically after the installation.
To check the status of PostgreSQL service, run:
Replace status with start, stop, restart to star, stop, and restart PostgreSQL service respectively.
Configure PostgreSQL Server
PostgreSQL server listens on localhost (127.0.0.1) by default. Sometimes, we need to configure PostgreSQL to listen on all adaptors or system IP address to allow applications hosted on external machines to connect to the database
Set the listen_addresses to * or <IPAddress>.
Restart the PostgreSQL service.
Confirm that the PostgreSQL listening on port 5432 using the netstat command.
Postgresql Gui Ubuntu Tutorial
READ: netstat command not found on Ubuntu 20.04 – Quick Fix
Access PostgreSQL
To manage the database, you need to log in as the postgres user.
Use the psql command to enter into the interactive shell for working with the PostgreSQL database.
Output:
Secure PostgreSQL database
We will now set a password for postgres (Unix User) as well as postgres (DB administrator).
Set password for Unix user (postgres)
Set password for DB administrator (postgres)
On psql shell, run below command to change the database administrator (postgres) password.