2

I just created a new cluster using PostgreSQL 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 don't know how to run it from an "unprivileged user ID". Any help would be great!

user972276
  • 309
  • 1
  • 4
  • 13

1 Answers1

5

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 ....
Chris Travers
  • 13,112
  • 51
  • 95