HomeMicrosoftHow to Download and Install PostgreSQL

How to Download and Install PostgreSQL

In this article, we will learn how to download and install PostgreSQL on Windows 10. We will show you the different ways to connect to a database in PostgreSQL and verify the installation. This guide explains how to install and set up a PostgreSQL database server and the psql command line. How to install and configure these components on your computer for local access.

Setting up PostgreSQL on Windows

The PostgreSQL project provides a native installer to install and configure your database.

Download PostgreSQL

Visit the PostgreSQL website to find a link to the installer. Choose Postgres and download the installer at the beginning of the page. On the page that follows, in the Windows x86-64 columns (depending on your computer’s specifications), choose the PostgreSQL version you want to install. Select Download your PostgreSQL version and then save the file to a convenient location.

Download and install PostgreSQL packages

Download and Install PostgreSQL on Windows

Go to the downloaded folder, and then run the PostgreSQL installer file to start the installation.

PostgreSQL installer

Welcome to the PostgreSQL setup wizard. Choose next.

Welcome to the PostgreSQL setup

Choose an installation location for PostgreSQL, and then click Next to proceed.

Install PostgreSQL installation directory

The next window allows you to select which components you want to install. Your minimum selection is PostgreSQL Server and Command Line Tools.

Install PostgreSQL select components

Now, choose the directory where the database data files will be saved, and then click Next.

Data directory PostgreSQL

Verify an administrative password for your PostgreSQL superuser (called Postgres) and then click next.

PostgreSQL setup password

Accept the default 5432 port, and then choose next.

PostgreSQL installation port

Install PostgreSQL’s advanced options, choose the locale that your database will use, and then click next.

PostgreSQL setup advanced options

The pre-installation summary of the PostgreSQL setup is now complete; click next.

Pre installation summary PostgreSQL

Click on the Install button to install PostgreSQL on your Windows computer.

Install PostgreSQL

The PostgreSQL installation is in progress.

Installing PostgreSQL

After completing the PostgreSQL setup, choose Finish.

Completing the PostgreSQL setup

Verify the PSQL Command Line Tool

After the installation is complete, you need to verify the installation using the psql command line tool. In the Windows search box, type psql, and then click on the tool to open the program.
Hit enter to accept the default choices provided in the square brackets. Type the Postgres password for the user that you configured during setup.
After successfully authenticating, you will be dropped into a synergistic psql session with your database. When you are finished, exit the session.

SQL Shell psql

Connect to the PostgreSQL Database

Open the pgAdmin 4 tool by searching in Windows Search or from the PostgreSQL folder.
Note: pgAdmin demands that you set a master password at the first launch and then click OK.

Set master password pgadmin

Right-click the Servers option on your left-hand side. Choose to register, and then choose the server to set up a new database server.

Pgadmin 4 PostgreSQL

In the General tab, type a name for the new database. In this scenario, we are using PostgreSQL as the database name.

PostgreSQL register server

Click on the Connection tab, type the hostname (the default is localhost), and then the password selected during the setup process. Choose Save.

Register server PostgreSQL

Expand the servers, and then expand the PostgreSQL icons. Click on the default Postgres database.

Pgadmin 4 databases

Click on the Tools menu, and click Query Tool to launch the query editor.

PostgreSQL tools menu

Verify your database in the query editor by typing the following command and then clicking on the Execute button.

select version();

If the PostgreSQL database is working fine, the current version of your database will appear in the Data Output window.

PostgreSQL query

Refer to the PostgreSQL website to learn in detail about downloading and installing PostgreSQL.

Jamil
Jamilhttp://jamiltech.com
A Professional Technology Blog Writer | An energetic professional with more than 20+ years of rich experience in Technology, Planning, Designing, Installation, and Networking.
RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments

what is cryptocurrency and bitcoin on How to Backup and Restore IIS Configuration
경기광주출장안마 on How to Backup and Restore IIS Configuration
영등포출장마사지 on How to Backup and Restore IIS Configuration
Twalsu light mirror for vanity on How to Backup and Restore IIS Configuration
fitspresso analysis on How to Reset Microsoft 365 Password
historical landmarks tours for history buffs on How to Add Hyper-V Server Altaro VM Backup
9780443186882 PDF download on How to Migrate Active Directory 2012 to 2022
Shaik Mohammad Jaheer on How to Enable Night Light on Windows 11