Hi! Let’s talk about databases. Here we have already studied it. Likewise, we saw how to install MySQL on windows server 2019. It is an advanced, enterprise-class open-source relational database that supports both SQL (relational) and JSON (non-relational) querying. Besides, supports transactions, subselects, triggers, views, foreign key referential integrity, and sophisticated locking. It is multiplatform and supports text, images, sounds, and video. So in this post, we are going to see how to install and configure PostgreSQL in Windows 10.
Downloading PostgreSQL
In the first place, is to download the installer from the website. There you have to select the most recent version (11.5 at the time of writing this article) and download it.
Once you have downloaded the installer, double click on it to start the installation.
Next, the wizard will ask for the installation directory. By default, it will be installed on the “c” drive, but you can select any other destination directory. Click next to continue the installation.
In the next screen choose the components to install. By default, all are selected, I recommend you keep it like this.
Now choose the directory where the data will be stored.
Sets the password for the superuser of the PostgreSQL database.
Choose a port number. The default is 5432. In like manner, you can always configure the firewall to allow the connections.
Additionally, select the regional configuration to use.
On the next screen, check all installation options. If you are satisfied, click Next to continue.
Immediately, the installation process will begin.
Once the installation is complete, the wizard will ask if we want to launch the stack builder to download and install additional tools.
In the event that you’ve decided to launch the Stack Builder, it’ll start running. In addition, you need to be connected to the internet and select your server.
The application list will then be downloaded. Furthermore, select the additional configuration required and click Next to complete the installation.
Running and Configuring PostgreSQL
To start PostgreSQL, go to the start menu and select pgAdmin4.
You will then be prompted for the password you created at the time of the installation.
Then click on the Server tab and enter the password again. When we connect, we will see the database displayed.
Solving SQL database issue
When you click on the SQL tab, an error message will appear. This is because the command line has not been configured for SQL. With this in mind, go to the route where the database was installed. And copy the next path: C:\Program Files\PostgreSQL\11\bin
Now follow this path: Control Panel> System and Security>System> Advanced System Settings.
In the pop-up window there are a number of options, please select Environment Variables
Please locate the path line.
What we are going to do is create a new path, with this in mind click on Edit. Next, select New and paste the route you just copied. Press Ok to continue.
This same procedure must be repeated with the following path: C:\Program Files\PostgreSQL\11\lib
After you have set all the changes, press OK to accept. Additionally, open a Command Prompt and runs the following command:
psql -U postgres postgres
You will be asked for your password, please enter it to access the database. Then reload the browser, click on the SQL tab and the connection to the database will be established.
Conclusion
Finally, we have learned how to install and configure PostgreSQL on Windows 10. It’s a long process, but it is worth a try to work with this database. Please visit our post about PowerToys in Windows 10. To keep up to date with updates on Windows 10, join our telegram channel.