Setup Postgres

PostgreSQL is an open-source relational database management system (RDBMS) that is widely used for managing and organizing large amounts of structured data. It provides a powerful and flexible platform for storing and retrieving data efficiently.

PostgreSQL follows a relational database model, which means it organizes data into tables with predefined structures. These tables consist of rows (records) and columns (attributes), allowing you to store and manipulate data in a structured manner. It enables you to store and organize large amounts of structured data efficiently. You can create tables to represent different entities and store relevant information in a well-structured manner. Also PostgreSQL provides a powerful query language called SQL (Structured Query Language) that allows you to retrieve and manipulate data from the database. You can perform complex queries, filtering, sorting, aggregations, and join operations to extract the information you need.

Installation

  1. Go to the PostgreSQL website and download the latest PostgreSQL version

  2. Run the installer. You should see a window like the following one:

  1. You have to specify the installation directory of PostgreSQL. You should not change this value.

  1. When you are asked which components you want to install select all the components.

  1. The data directory should be left as it is.

  1. Now you need to define a password for the database. On local systems usually something easy like "root" is used, but only if the database only runs on your local machine. For a database that runs on a server you should choose a better password. Also remember this password, we will need it later when we connect our REST API to the database.

Now we need to specify a port on which the database listens. The default port is 5432 and should be left as it is. So our database will be accessible under localhost:5432 or 127.0.0.1:5432. Remeber that websites also listen to ports, by default port 80 or 443 when the website uses SSL? This is what we call a computer network. localhost is the name of the machine where our application runs on. Localhost always means that our applications are running on our own machine and are not visible from outside. 5432 is the port which can be compared to a house number where our network traffic can be sent to.

The advanced should not be changed.

Last updated