sudo apt install postgresql libpq-dev postgresql-client postgresql-client-common -y
Here is what the above code is Doing:
1. Install the PostgreSQL server and client packages.
2. Create a new PostgreSQL user named catalog with limited permissions to your catalog application database.
3. Create an empty database named catalog and grant all privileges on the database to the catalog user.
4. Update the default PostgreSQL configuration so that remote connections to the database are possible.
5. Update the /etc/postgresql/9.5/main/pg_hba.conf file to change the authentication method for local connections from peer to md5.
6. Restart the PostgreSQL service to apply the changes.