Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I just created a new postgresql cluster in postgres 8.3 and looks like everything worked. What I am having issues with is trying to start the server of this new cluster. My two clusters are on different ports. When looking online to start the new cluster, I tried executing the following line:

postgres -D C:\my\new\cluster\data\directory

this is the error I get:

The server must be started under an unprivileged user ID to prevent possible system security compromises. See the documentation for more information on how to properly start the server.

So I know I am running the command from administrator but I dont know how to run it from an "unprivileged user ID". Any help would be great!

share|improve this question
2  
Are there any other accounts with which you can login to the server? Also, I've found pg_ctl to be quite useful. Finally, why are you running 8.3? It's not supported anymore. –  swasheck Feb 19 '13 at 23:00
2  
You shouldn't be working as "administrator" in the first place. The 8.3 installer should have created a "postgres" Windows user. Use that (e.g. trough runas) to start the server. But you should really upgrade to a current (and supported) version. –  a_horse_with_no_name Feb 19 '13 at 23:06
add comment

1 Answer

up vote 3 down vote accepted

Aside from the upgrade recommendation (which I second btw but will not solve your current problem) your basic issue is that PostgreSQL will not run as an administrative user. This is a security feature.

Now, if this is a desktop not on a domain model, you need to create a limited user, and run initdb as that (or assign ownership to all files under the existing second cluster to that user if it already exists which it may). Then read the runas documentation.

Then run something like:

 runas /user:<computername>\postgres postgres -D C:\my\new\cluster\data\directory

So if your computer name is mycomputer, it would look like:

runas /user:mycomputer\postgres postgres -D C:\my\new\cluster\data\directory

You can also:

pg_ctl register -N postgresqlc2 -U postgres -P [password] -D C:\my\new\cluster\data\directory ....
share|improve this answer
    
+1 ... then you can start and stop the service from services.msc or through command line net start postgresqlc2 and net stop postgresqlc2 –  swasheck Feb 20 '13 at 3:50
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.