The PostgreSQL installation in windows

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:

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.

Install PostgreSQL - download file

Step 2. Click the Next button

Install PostgreSQL - step 1

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

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

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

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

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.

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

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

The installation may take a few minutes to complete.

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

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.

Install PostgreSQL - psql

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:

Install PostgreSQL - Connect to PostgreSQL via psql

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

posted @ 2019-08-31 01:47 功夫 熊猫 阅读(...) 评论(...) 编辑 收藏