Install PostgreSQL in Windows

Source: Internet
Author: User
① To The http://www.postgresql.org/download the no installer version of postgresql for win. The latest version is 8.2.5-1. Directly decompress the package. For example:
C: \ PostgreSQL
② Set Environment Variables
C:> set pghome = c: \ PostgreSQL
C:> set pgdata = % pghome % \ data
C:> set pglib = % pghome % \ Lib
C:> set pghost = localhost
C:> set Path = % pghome % \ bin; % PATH %

③ Initdb initializes the database.
④ Pg_ctl start the database
⑤ Pg_ctl stop the database
⑥ Post_svc-install create a Windows NT Service (you need to set the system environment variable)
7. post_svc-Remove Delete the Windows NT Service
⑧ Use "createdb database name" to create a database
⑨ Use "createuser username" to create a database account
⑩ Use "Psql-H localhost-D database name-u User Name" to enter the database

Tip:

You can use pgadmin, a GUI management tool.

 

initdb -- create a new PostgreSQL database cluster
ipcclean -- delete shared memory and traffic signals from an invalid PostgreSQL server
pg_controldata -- display the control information of a PostgreSQL Cluster
pg_ctl -- start, stop and restart postgresql
pg_resetxlog -- reset the pre-write log and other control content of a PostgreSQL database cluster
S -- run a PostgreSQL server in single-user mode
Postmaster -- PostgreSQL multi-user database server
clusterdb -- cluster a PostgreSQL database
createdb -- create a new PostgreSQL database
createlang -- define a new PostgreSQL process Language Statement
createuser -- define a new PostgreSQL user account
dropdb -- delete an existing PostgreSQL database
droplang -- delete a PostgreSQL process language
dropuser -- delete one PostgreSQL user account
ecpg -- embedded SQL C Preprocessor
pg_config -- retrieves information about the installed version of postgresql
pg_dump -- extracts a PostgreSQL database into one in the script file or other archive files,
pg_dumpall -- extract a PostgreSQL database cluster to the script file
pg_restore -- restore the PostgreSQL database from a backup file created by pg_dump.
Psql -- PostgreSQL interaction terminal
vacuumdb -- collects garbage and analyzes a PostgreSQL database

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.