PostgreSQL is a powerful, open-source relational database management system (RDBMS) that is known for its extensibility and standards compliance. It is often used as a backend database for web applications and supports a variety of data types, indexing, and advanced features like transactions and foreign keys.

psql -h hostname -d database -U username 

# To list all the users

# To list a username if present
\du username

# To list all databases

# Connect to a database
\connect database_name

# List all the tables in the current database

# Describe a table
\d+ table_name

# Execute Query
SELECT * FROM <table>;

# Quit

Managing postgresql service

sudo service postgresql stop
sudo service postgresql start
sudo service postgresql restart