protoculture-dotnet-postgres
protoculture-dotnet-postgres copied to clipboard
Why does not work to be run as admin?
Please explain why it cannot run as admin Thanks
Hey! I was just as surprised, but apparently postgres errors out and terminates itself when run as admin.
I run postgres directly so that I can monitor the process, so this ended up being a limitation.
When you run pg_ctl
as administrator, it's actually spawning the postgres
process as a non-administrator account. But if I used pg_ctl
to run postgres, it would not be as easy to monitor the process.
Well, can you intercept the errors ? Maybe we can figure why - and possibly solve it.
Not that I'm aware of, this is mainly because the error isn't originating from my own code. It's the postgres
executable itself that has this limitation -- which is outside of my control.
If the .NET process APIs have the ability to run processes as a specific user other than the current one, then there might be something.
That being said, I certainly won't rule out any tricks or strategies. Just keep in mind that it's very difficult to work with process identity in Windows.
Process. StartInfo. UserName
I'll look into it :slightly_smiling_face: