Install PostgreSQL on Ubuntu with:
sudo apt -y install postgresql-14
Visit here for more.
Install PostgreSQL on Windows with the following steps:
C:\Program Files\PostgreSQL\14
for field “Installation Directory”
and click on “Next”. In page “Select Components”, uncheck “PostgreSQL Server”, “pgAdmin 4”, “Stack Builder”, check
“Command Line Tools”, and click on “Next”. In both next pages “Pre Installation Summary” and “Ready to Install””,
click on “Next”. Wait for the installation to be completed. Finally, click on “Finish”;psql.exe
to the
Path environment variable. In my case, the directory to add to the Path is C:\Program Files\PostgreSQL\14\bin
, but
it could be different in your machine. Bear in mind that the directory should contain the file with name psql.exe
.
To add the directory to the Path, click on “Start” > “Settings” > “System” > “About” > “Advanced system settings” >
“Advanced tab” > “Environment Variables”. Then, select the “Path” under “System variable” and click on “Edit”. In the
new window, click on “New”, paste the directory of the PostgreSQL executable file and press “Enter”. Finally, click
“OK” in the last three opened windows “Edit environment variable”, “Environment Variables” and “System Properties”;psql --version
from the new terminal.
If the installation were properly installed, the command should print the PostgreSQL version installed into your
machine.TODO