① 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