PostGIS (decompression version) installation

Source: Internet
Author: User
Tags psql postgis server port

1. Software Download

2. Unzip the

Unzip the to the installation directory you want (D:\GreenSoftware\PostgreSQL961), it is best not to have Chinese or space,

3. Create a data storage directory (D:\GreenSoftware\PostgreSQL961\data)

4. Initializing the database

D:\GreenSoftware\PostgreSQL961\bin\initdb.exe-D D:\GreenSoftware\PostgreSQL961\data-E UTF8--locale=chinese

5. Start the database in one of two ways

5.1 First way: Registering as a Windows service mode

5.1.1 Registration Service

D:\GreenSoftware\PostgreSQL961\bin\pg_ctl.exe register-d D:\GreenSoftware\PostgreSQL961\data-Npgsql

-n indicates that the Windows service name is Pgsql;

5.1.2 Start Service

net start Pgsql

If your installation is not an error, you should be able to get up now.

5.1.3 Close Service

net stop Pgsql

5.1.4 Uninstall Service

D:\GreenSoftware\PostgreSQL961\bin\pg_ctl.exe unregister-d D:\greensoftware\postgresql961\data–npgsql

5.2 Second way: Direct start mode

5.2.1 Start

D:\GreenSoftware\PostgreSQL961\bin\pg_ctl.exe Start-w-D D:\GreenSoftware\PostgreSQL961\data

5.2.2 off

D:\GreenSoftware\PostgreSQL961\bin\pg_ctl.exe Stop-w-D D:\GreenSoftware\PostgreSQL961\data

6 Creating a database

D:\GreenSoftware\PostgreSQL961\bin\createdb.exe-E UTF8 Geodb

D:\GreenSoftware\PostgreSQL961\bin\dropdb.exe Geodb

7 Creating a user

D:\GreenSoftware\PostgreSQL961\bin\createuser.exe-s-R Postgres

There will be an option to create a superuser, create a superuser named Postgres;

How to use:

CreateUser [Options] ... [User Name]


-C, connection limit for--connection-limit=n role (default: No Limit)

-D,--createdb this role can create a new database

-D,--no-createdb this role is not available to create a new database

-E,--echo Show commands sent to the server

-E,--encrypted password encrypted storage

-I, the--inherit role can inherit the permissions of the role it belongs to

(This is the default)

-I,--no-inherit role does not inherit permissions

-L,--login role can log on (this is the default)

-L,--no-login role cannot log on

-N,--unencrypted password unencrypted storage

-P,--pwprompt assigning a password to the new role

-R,--createrole This role can create a new role

-R,--no-createrole This role does not have permissions to create other roles

-S,--superuser role will be super user

-S, the--no-superuser role cannot be a super user

--HELP Display this help message, and then exit

--version output version information, and then exit

Join options:

-H, the host name or socket directory of the machine where the--host=hostnam database server resides

-p,--port=port database server port number

-U,--username=username join user (not the user name to be created)

-W,-no-password never prompt to enter a password

-W,--password Force prompt for password

If-D,-R,-R,-S,-S, and ROLENAME are not specified, an interactive prompt will be used


Bug report to <[email Protected]>.

Example 1:>createuser-p-d-u postgres dan

Explanation:-P (uppercase) is to specify a password for the new user;-D says whether the role can create a database;-U (uppercase) The current operation is issued by which user; The last Dan is the name of the new user.


View users in the system: SELECT * from Pg_user;

Delete a User: Drop the user Dan, where Dan is the username

D:\GreenSoftware\PostgreSQL961\bin\dropuser.exe Postgres

7.1 Modifying user passwords

7.1.1 First way: Apply the Psql command

D:\GreenSoftware\PostgreSQL961\bin\psql.exe Postgres

postgres=# alter user postgres with password ' xxx ';

postgres-# \q

7.1.2 Second way: To modify with Pgadmin

With Pgadmin connection to the server, you can directly modify the password;

8 Unzip the

Unzip the to a directory without Chinese or white space.

9 Modify Makepostgisdb_using_extensions.bat file

10 importing spatial data into PostGIS

11 displaying spatial data in PostGIS

PostGIS (decompression version) installation

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: 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.