PostgreSQL installation and configuration tutorial on Windows and postgresql installation tutorial
PostgreSQL extension PostGIS is the most famous open source GIS database.
Installing PostgreSQL is the first step.
1. Download the binary Installation File of PostgreSQL.
PostgreSQL official website-> Download-> Windows 64-bit ,:
(1) Official Website:
Https://www.postgresql.org/
(2) Download:
Https://www.postgresql.org/download/
Https://www.postgresql.org/download/windows/
(3) Windows 64-bit (based on your system version)
Https://www.enterprisedb.com/download-postgresql-binaries
2. decompress the package and configure the environment variables.
(1) first create a folder named data under the pgsql (D: \ 01Software \ Database \ postgresql-9.6.2-2-windows-x64-binaries \ pgsql) folder (this is the data storage folder of the Database)
(2) create a file named env. vbs in the pgsql folder.
The file content is as follows:
on error resume nextset sysenv=CreateObject("WScript.Shell").Environment("system") 'system environment arrayPath = CreateObject("Scripting.FileSystemObject").GetFolder(".").Path 'add variablesysenv("PGHOME")="D:\01Software\Database\postgresql-9.6.2-2-windows-x64-binaries\pgsql"sysenv("PGHOST")="localhost"sysenv("Path")=sysenv("PGHOME")+"\bin;"+sysenv("Path")sysenv("PGLIB")=sysenv("PGHOME")+"\lib"sysenv("PGDATA")=sysenv("PGHOME")+"\data"wscript.echo "PostgreSQL Success"
(3) finally run this script
3. initialize the database
Open the command prompt as an administrator, locate to the bin directory, and enter the following command:
Copy codeThe Code is as follows: initdb.exe-D: \ 01Software \ Database \ postgresql-9.6.2-2-windows-x64-binaries \ pgsql \ data-E UTF-8 -- locale = chs-U postgres-W
-U postgres indicates that the superuser's username is postgres.
4. Start the database
Enter the following command in the bin directory as an administrator to generate a logfile file in the specified path.
Copy codeThe Code is as follows: pg_ctl-D: \ 01Software \ Database \ postgresql-9.6.2-2-windows-x64-binaries \ pgsql \ logfile-l logfile start
5. register the service
Run the following command in the bin directory as an administrator and then start the service.
Copy codeCode: pg_ctl register-N PostgreSQL-D: \ 01Software \ Database \ postgresql-9.6.2-2-windows-x64-binaries \ pgsql \ data
6. Use PgAdmin to establish a database connection
Under D: \ 01Software \ Database \ postgresql-9.6.2-2-windows-x64-binaries \ pgsql \ pgAdmin 4 \ bin, there is pgadmin4.exe, double-click to open.
I am using the connection established by the Super User postgres.
Reference: how to download and configure Postgresql in Windows
The above is all the content of this article. I hope it will be helpful for your learning and support for helping customers.