How to Install PostgreSQL on Windows
PostgreSQL (also known as Postgres) is a free and open-source relational database system. PostgreSQL highlights that it uses and extends the SQL programming language, combined with numerous other features that enable the safe storage and scaling of complicated data tasks.
PostgreSQL's heritage dates to the POSTGRES project at the University of California at Berkley in 1986. The current edition of PostgreSQL was first released back in 1996. PostgreSQL conforms strongly to SQL standard. As of the version 16 release in September 2023, it conforms to at least 170/179 mandatory features for SQL.
PostgreSQL has many features, such as support for numerous data types, including primitive types like integer, string, and Boolean, structured data types such as date/time, and security features, including authentication.
Follow the below instructions for how to download PostgreSQL on Windows devices.
Installing PostgreSQL
- PostgreSQL can be downloaded here. Download the latest Windows x86-64 version, which was 16.3 at the time of writing this article.
- Once you click the download icon, you will be transferred to another page, informing you that the download process will begin in a few seconds.
- Open the installer file in your downloads. You will be asked if you want to allow the app to make changes to your device, click yes.
- You will now be greeted with the Welcome to the PostgreSQL Setup Wizard; click next.
- Next, you will be asked to specify an installation directory. The default path is typically C:\Program Files\PostgreSQL\version. You can change this if you would like, but keeping the default path is always preferable.
- Select the components you wish to install; you can click the component's name to read more about them. The descriptions are:
- PostgreSQL Server: the database server.
- Stack builder: a GUI to install additional software to go with the PostgreSQL installation.
- Pg4Admin 4: a graphical interface for managing and working with PostgreSQL database and servers.
- Command-line tools: this option installs command-line tools and client libraries. The command-line tools are required when installing the PostgreSQL database server or pgAdmin 4.
- You must install PostgreSQL Server and command-line tools to download PostgreSQL. Pg4Admin is a highly favoured GUI for working with PostgreSQL that you should download. Stack builder is not a necessary component to download, but it is a handy GUI for installing additional software. More info on stack builder can be found here. Once you have selected the components you want, press next.
- The next stage is to confirm where the database data will be stored. The default path is typically C:\Program Files\PostgreSQL\version\data. You can change this if you would like, but best practice is to keep the default path. Press next.
- Choose a password for your database. PostgreSQL uses the password specified at this stage for both the database superuser and the PostgreSQL service account. Once you have finished entering and retyping your password, press next.
- Select the port the server should listen on; the default listener is 5432. Press next.
- Set the locale to be used for the new database cluster. The default locale is the operating system locale. Once you have made your selection, press next.
- Next, you will see a pre-installation summary. This displays the installation preferences that you chose with the installation wizard. If you are unsatisfied with any of the selections, use the back button to return to the previous sections and modify your selections. When you are satisfied with your selections, press next.
- The setup is now ready to start installing on your computer. Select next to begin the installation.
- You will now be asked to wait as PostgreSQL installs onto your device. The progress of the installation is represented using a horizontal bar.
- You will be informed that PostgreSQL has finished setting up on your computer once the installation is complete. If you installed Stack Builder, you will also be given the option to launch the software. Keep the box ticked to launch it, and then press finish.
Conclusion
Congrats! You have finished installing PostgreSQL. We hope you enjoyed this tutorial on installing PostgreSQL on Windows devices.