Sometimes, when installing PostgreSQL windows, it will fail to create a Windows service. After you cancel the "Install as service" option, how can you manually install it as a service?
1. first, check the user, that is, the user who starts the postgresql service. The default user is ipvs, choose "Control Panel"> "Computer Management"> "local users and groups" to check whether there are ipvs users. If yes, delete the user first.
2. Add the Postgres user through the command line, as shown below:C :\>Net user ipvs pass/Add/Expires: Never/passwordchg: No
The above command creates an ipvs user. The password is pass. The user account does not expire and the user cannot change the password.
After the user is created, the user is deleted from the Users Group as follows:C :\>Net localgroup users ipvs/Delete
3. create a postgresql service with the following command: (assume that our database is created under E: \ pgsql \ data and use the createdb command to create a database) D: \ Program Files \ PostgreSQL \ 8.2 \ bin > pg_ctl register - N postgresql - U Postgres - P pass - d e: \ pgsql \ data
4. Specify the access permissions of the ipvs user as follows:D: \ Program Files \ PostgreSQL \8.2>Cacls./T/E/P Postgres: R
The above command sets the directory readable for the D: \ Program Files \ PostgreSQL \ 8.2 directory by the Postgres user.
E: \ pgsql > Cacls. / T / E / P Postgres: R
E: \ pgsql > Cacls data / T / E / P Postgres: c
The preceding command sets the writable directory for E: \ pgsql \ data)
5. Start PostgreSQL in the service.