Windows installation PostgreSQL

Source: Internet
Author: User
Tags create directory postgresql psql

Download binary package: https://www.enterprisedb.com/download-postgresql-binaries

Unzip directly to C drive

Microsoft Windows [version 6.3.9600]
(c) Microsoft Corporation. All rights reserved.

C:\USERS\XXXX>CD C:\postgresql-9.6.2-4-windows-x64-binaries\pgsql\bin

C:\postgresql-9.6.2-4-windows-x64-binaries\pgsql\bin>
C:\postgresql-9.6.2-4-windows-x64-binaries\pgsql\bin>initdb.exe-d C:\postgresql
-9.6.2-4-windows-x64-binaries\pgsql\data-e sql_ascii-u Postgres--locale=c
The file host belonging to this database system is the user "XXXX".
This user must also be the host for the server process.
The database cluster is initialized with the localized language "C".
The default text-search configuration will be set to "中文版"

Suppresses the generation of checksums for data pages.

Create Directory C:/postgresql-9.6.2-4-windows-x64-binaries/pgsql/data ... Success
Creating sub-Directory ... Success
Select default maximum number of joins (max_connections) ... 100
Select the default shared buffer size (shared_buffers) ... 128MB
Select dynamic shared memory implementation ... windows
Create configuration file ... Success
Running Bootstrap script ... Success
Performing bootstrap initialization ... Success
Synchronizing data to disk ... Success

Warning: "Trust" authentication has been initiated for the local connection.
You can change by editing pg_hba.conf or your next
Use the-A or--auth-local and--auth-host options when line Initdb.

Success. You can now open the database server with the following command:

"Pg_ctl"-D "C:\postgresql-9.6.2-4-windows-x64-binaries\pgsql\data"-l LOGFI
Le start


C:\postgresql-9.6.2-4-windows-x64-binaries\pgsql\bin>pg_ctl.exe-d C:\postgresql
-9.6.2-4-windows-x64-binaries\pgsql\data start
Starting server process

C:\postgresql-9.6.2-4-windows-x64-binaries\pgsql\bin>log:database system was s
Hut down at 2017-04-24 16:21:01 HKT
Log:multixact member wraparound protections is now enabled
Log:database system is ready to accept connections
Log:autovacuum Launcher started

C:\postgresql-9.6.2-4-windows-x64-binaries\pgsql\bin>pg_config.exe C:\postgresql
-9.6.2-4-windows-x64-binaries\pgsql\data
Pg_config: Invalid parameter: C:\postgresql-9.6.2-4-windows-x64-binaries\pgsql\data
Please use "Pg_config--help" for more information.

C:\postgresql-9.6.2-4-windows-x64-binaries\pgsql\bin>pg_controldata.exe C:\POSTG
Resql-9.6.2-4-windows-x64-binaries\pgsql\data
Pg_control Version: 960
Catalog version: 201608131
Database system identifier: 6412480914966795996
Database cluster Status: in Run
Pg_control Last modified: 2017/4/24 16:23:59
Latest Checkpoint Location: 0/14eb8b0
Priority Checkpoint Location: 0/14eb618
REDO location of the latest checkpoint: 0/14eb8b0
Redo log files for the latest checkpoint: 000000010000000000000001
Timelineid:1 of the latest checkpoint
Prevtimelineid:1 of the latest checkpoint
Full_page_writes of the latest checkpoint: Open
nextxid:0:542 of the latest checkpoint
nextoid:12402 of the latest checkpoint
Nextmultixactid:1 of the latest checkpoint
Nextmultioffsetd:0 of the latest checkpoint
oldestxid:535 of the latest checkpoint
Database of the latest checkpoint OLDESTXID: 1
Oldestactivexid:0 of the latest checkpoint
Oldestmultixid:1 of the latest checkpoint
Database of the latest checkpoint Oldestmulti: 1
Oldestcommittsxid:0 of the latest checkpoint
Newestcommittsxid:0 of the latest checkpoint
Time of latest checkpoint: 2017/4/24 16:21:01
Relationship without log: 0/1 using false LSN counters
Minimum recovery end Position: 0/0
Minimum recovery end Location schedule: 0
Point location at which to start the backup: 0/0
Final location of backup: 0/0
Records that require a backup to be terminated: no
Wal_level settings: Minimal
Wal_log_hints settings: Off
Max_connections Settings: 100
Max_worker_processes Settings: 8
Max_prepared_xacts Settings: 0
Max_locks_per_xact Settings: 64
Track_commit_timestamp settings: Off
Maximum Data calibration: 8
Database Block Size: 8192
Number of blocks per segment of a large relationship: 131072
Wal's block Size: 8192
Each WAL segment bytes: 16777216
Maximum length of identifier: 64
Maximum number of columns allowed in an index: 32
Maximum toast chunk Length: 1996
Size of large object chunk: 2048
Date/Time Type storage: 64-bit integers
Passing parameters of type FLLOAT4: by value
Passing parameters of type Flloat8: by value
Data page Checksum version: 0

C:\postgresql-9.6.2-4-windows-x64-binaries\pgsql\bin>psql.exe-h 127.0.0.1-p 54
32-u Postgres Postgres
Psql (9.6.2)
Enter "Help" for information.

postgres=# CREATE TABLE test (ID int primary key,info text,crt_time timestamp);
CREATE TABLE

postgres=# INSERT INTO Test select Generate_series (1,1000), MD5 (Random ():: text), C
Lock_timestamp ();
INSERT 0 1000
postgres=# checkpoint;
CHECKPOINT
postgres=# show Port;
Port
------
5432
(1 Line Records)


postgres=# \q

C:\postgresql-9.6.2-4-windows-x64-binaries\pgsql\bin>pg_ctl.exe-d C:\postgresql
-9.6.2-4-windows-x64-binaries\pgsql\data stop-m Fast
Log:received Fast Shutdown Request
Wait for server log:aborting any active transactions
Process off Log:autovacuum launcher shutting down
Closed.... Log:shutting down
Log:database system is shut down
Complete
Server process is down

C:\postgresql-9.6.2-4-windows-x64-binaries\pgsql\bin>

Windows installation PostgreSQL

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.