Summary: in this tutorial, we will show you how to install PostgreSQL on your local system for learning and practicing PostgreSQL.

PostgreSQL was developed for UNIX-like platforms, however, it was designed to be portable. It means that PostgreSQL can also run on other platforms such as Mac OS X, Solaris, and Windows.

Since version 8.0, PostgreSQL offers an installer for Windows systems that makes the installation process easier and faster. For development purpose, we will install PostgreSQL version 11.3  on Windows 10.

There are three steps to complete the PostgreSQL installation:

  1. Download PostgreSQL installer for Windows
  2. Install PostgreSQL
  3. Verify the installation

Download PostgreSQL Installer for Windows

First, you need to go to the download page of PostgreSQL installers on the EnterpriseDB.

Second, click the download link as shown below:

The PostgreSQL installation in windows

It will take a few minutes to complete the download.

Install PostgreSQL step by step

Step 1. Double click on the installer file, an installation wizard will appear and guide you through multiple steps where you can choose different options that you would like to have in PostgreSQL.

The PostgreSQL installation in windows

Step 2. Click the Next button

The PostgreSQL installation in windows

Step 3. Specify installation folder, choose your own or keep the default folder suggested by PostgreSQL installer and click the Next button

The PostgreSQL installation in windows

Step 4. Select components to install and click the Next button

The PostgreSQL installation in windows

Step 5. Select the database directory to store the data. Just leave it by default or choose your own and click the Next button.

The PostgreSQL installation in windows

Step 6. Enter the password for the database superuser (postgres)

The PostgreSQL installation in windows

Step 7. Enter the port for PostgreSQL. Make sure that no other applications are using this port. Leave it as default if you are unsure.

The PostgreSQL installation in windows

Step 8. Choose the default locale used by the database and click the Next button.

The PostgreSQL installation in windows

Step 9. Ready to install PostgreSQL. Click the Next button to start installing.

The PostgreSQL installation in windows

The installation may take a few minutes to complete.

The PostgreSQL installation in windows

Step 10. Click the Finish button to complete the PostgreSQL installation.

The PostgreSQL installation in windows

Verify the Installation

There are several ways to verify the installation. You can try to connect to the PostgreSQL database server from any client application e.g.,  psql and pgAdmin.

The quick way to verify the installation is through the psql program.

First, click the psql icon to launch it. The psql window command line will display.

The PostgreSQL installation in windows

Second, enter all the necessary information such as the server, database, port, username, and password. To accept the default, you can press Enter.  Note that you should provide the password that you entered during installing the PostgreSQL.

Third, issue the command SELECT version(); you will see the result as follows:

The PostgreSQL installation in windows

Congratulation! you’ve successfully installed PostgreSQL database server on your local system. Let’s learn various ways to connect to PostgreSQL database server.

相关文章:

  • 2021-07-07
  • 2021-04-05
  • 2022-12-23
  • 2021-10-28
  • 2021-12-03
  • 2021-12-27
  • 2022-12-23
  • 2022-02-20
猜你喜欢
  • 2022-12-23
  • 2021-07-21
  • 2021-07-08
  • 2021-06-30
  • 2021-07-28
  • 2021-08-03
  • 2021-06-01
相关资源
相似解决方案