Hi evapollard,
We have installed Postgresql 11.2 through command line on Windows 7.
Have used --install_runtimes yes as it has values yes, no (Windows only.)
Internet explorer 11 for windows 10 64 bit free download. I f you are installing PostgreSQL into a Windows system that is configured with User Account Control (UAC) enabled, you can assume sufficient privileges to invoke the graphical installer by right clicking on the name of the installer and selecting Run as administrator from the context menu. If prompted, enter an administrator password to continue. If you have installed Postgres through the installer, you should start the Windows service instead of running pgctl manually, e.g. Using: net start postgresql-9.5 Note that the name of the service might be different in your installation.
Install Postgres 11.2 Windows
The machine was restarted and the postgresql service named postgres-x64-11 was running.
Install Postgres 11.2 Windows 7
Below is the link for reference.
C:>
C:>postgresql-11.2-1-windows-x64.exe --mode unattended --unattendedmodeui minimal --install_runtimes yes --serverport 5433 --servic
ename postgres-x64-11 --superpassword postgres --datadir C:edbpostgresdata
C:>postgresql-11.2-1-windows-x64.exe --mode unattended --unattendedmodeui minimal --install_runtimes yes --serverport 5433 --servic
ename postgres-x64-11 --superpassword postgres --datadir C:edbpostgresdata
C:>cd 'C:Program FilesPostgreSQL11'bin
C:Program FilesPostgreSQL11bin>psql -p 5433 -U postgres
Password for user postgres:
psql (11.2)
WARNING: Console code page (437) differs from Windows code page (1252)
8-bit characters might not work correctly. See psql reference
page 'Notes for Windows users' for details.
Type 'help' for help.
Password for user postgres:
psql (11.2)
WARNING: Console code page (437) differs from Windows code page (1252)
8-bit characters might not work correctly. See psql reference
page 'Notes for Windows users' for details.
Type 'help' for help.
postgres=# l+
List of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges | Size | Table
space | Description
-----------+----------+----------+----------------------------+----------------------------+-----------------------+---------+------
------+--------------------------------------------
postgres | postgres | UTF8 | English_United States.1252 | English_United States.1252 | | 7683 kB | pg_de
fault | default administrative connection database
template0 | postgres | UTF8 | English_United States.1252 | English_United States.1252 | =c/postgres +| 7529 kB | pg_de
fault | unmodifiable empty database
| | | | | postgres=CTc/postgres | |
|
template1 | postgres | UTF8 | English_United States.1252 | English_United States.1252 | =c/postgres +| 7529 kB | pg_de
fault | default template for new databases
| | | | | postgres=CTc/postgres | |
|
(3 rows)
List of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges | Size | Table
space | Description
-----------+----------+----------+----------------------------+----------------------------+-----------------------+---------+------
------+--------------------------------------------
postgres | postgres | UTF8 | English_United States.1252 | English_United States.1252 | | 7683 kB | pg_de
fault | default administrative connection database
template0 | postgres | UTF8 | English_United States.1252 | English_United States.1252 | =c/postgres +| 7529 kB | pg_de
fault | unmodifiable empty database
| | | | | postgres=CTc/postgres | |
|
template1 | postgres | UTF8 | English_United States.1252 | English_United States.1252 | =c/postgres +| 7529 kB | pg_de
fault | default template for new databases
| | | | | postgres=CTc/postgres | |
|
(3 rows)
postgres=#
Installation Details are as below.Location is C:Program FilesPostgreSQL11installation_summary
Installation Directory: C:Program FilesPostgreSQL11
Server Installation Directory: C:Program FilesPostgreSQL11
Data Directory: C:edbpostgresdata
Database Port: 5433
Database Superuser: postgres
Operating System Account: NT AUTHORITYNetworkService
Database Service: postgres-x64-11
Command Line Tools Installation Directory: C:Program FilesPostgreSQL11
pgAdmin4 Installation Directory: C:Program FilesPostgreSQL11pgAdmin 4
Stack Builder Installation Directory: C:Program FilesPostgreSQL11stackbuilder
Installation completed at: 2019-08-22(YYYY-MM-DD) - 17:54:02(HH:MM:SS)
Summary: in this tutorial, you will step by step learn how to install PostgreSQL on your local system.
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 macOS, Solaris, and Windows.
Since version 8.0, PostgreSQL offers an installer for Windows systems that makes the installation process easier and faster. For development purposes, we will install PostgreSQL version 12 on Windows 10.
There are three steps to complete the PostgreSQL installation:
- Download PostgreSQL installer for Windows
- Install PostgreSQL
- Verify the installation
1) 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.
2) Install PostgreSQL on Window step by step
To install PostgreSQL on Windows, you need to have administrator privileges.
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.
Step 2. Click the Next button
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 software components to install:
- The PostgreSQL Server to install the PostgreSQL database server
- pgAdmin 4 to install the PostgreSQL database GUI management tool.
- Command Line Tools to install command-line tools such as psql, pg_restore, etc. These tools allow you to interact with the PostgreSQL database server using the command-line interface.
- Stack Builder provides a GUI that allows you to download and install drivers that work with PostgreSQL.
For the tutorial on this website, you don’t need to install Stack Builder so feel free to uncheck it and click the Next button to select the data directory:
Step 5. Select the database directory to store the data or accept the default folder. And click the Next button to go to the next step:
Step 6. Enter the password for the database superuser (postgres)
PostgreSQL runs as a service in the background under a service account named
postgres
. If you already created a service account with the name postgres
, you need to provide the password of that account in the following window.After entering the password, you need to retype it to confirm and click the Next button:
Step 7. Enter a port number on which the PostgreSQL database server will listen. The default port of PostgreSQL is 5432. You need to make sure that no other applications are using this port.
Step 8. Choose the default locale used by the PostgreSQL database. If you leave it as default locale, PostgreSQL will use the operating system locale. After that click the Next button.
Step 9. The setup wizard will show the summary information of PostgreSQL. You need to review it and click the Next button if everything is correct. Otherwise, you need to click the Back button to change the configuration accordingly.
Now, you’re ready to install PostgreSQL on your computer. Click the Next button to begin installing PostgreSQL.
The installation may take a few minutes to complete.
Step 10. Click the Finish button to complete the PostgreSQL installation.
3) Verify the Installation
There are several ways to verify the PostgreSQL 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
application to launch it. The psql command-line program will display.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 following output:Congratulation! you’ve successfully installed PostgreSQL database server on your local system. Let’s learn various ways to connect to PostgreSQL database server.