0
votes

I have a service does not start PostgreSQL. To view the error log, you can use the command (not to run out of the administrator):

C:\Program Files\PostgreSQL\9.3\bin>runas /user:postgres "C:\Program Files\PostgreSQL\9.3\bin\postgres -D "C:\Program Files\PostgreSQL\9.3\data""

However, after entering this command error appears:

    RUNAS [ [/noprofile | /profile] [/env] [/savecred | /netonly] ]
    /user:<username> <program>

    RUNAS [ [/noprofile | /profile] [/env] [/savecred] ]
    /smartcard [/user:<username>] <program>

    RUNAS /trustlevel:<trustlevel> <program>

    /noprofile <...>
    /profile <...>
<...>


Can you please tell how to write this command?

2

2 Answers

0
votes

It looks like you have extra spaces in your command at the end that may be messing things up and I believe you have to specify the hostname or domain where the user account exists. Try this: runas /user:hostname\postgres "C:\Program Files\PostgreSQL\9.3\bin\postgres -D C:\Program Files\PostgreSQL\9.3\data"

0
votes

As follows from this Super User thread, nested quotes in RUNAS should be escaped with a backslash. So, your command should look like this:

runas /user:postgres "C:\Program Files\PostgreSQL\9.3\bin\postgres -D \"C:\Program Files\PostgreSQL\9.3\data\""