- Uninstall PostgreSQL
- Abra o prompt de comando como adm e digite: net user postgres /delete
- Control Panel -> User Accounts -> Configure advanced user profile properties -> delete all “Unknown User” instances that seem to be left from postgres
- * compmgmt.msc -> Local Users and Groups -> Users -> New User… -> User name: postgres, Password: postgrespass -> Create
- compmgmt.msc -> Local Users and Groups -> Users -> postgres -> Member of -> Add… -> Administrators -> OK
- copy postgresql-8.4.9-1-windows.exe to C:\
- runas /user:postgres cmd.exe -> cd \ -> postgresql-8.4.9-1-windows.exe -> installed successfully without errors. Checked data folder and confirmed files created successfully.
- compmgmt.msc -> Local Users and Groups -> Users -> postgres -> Member of -> Administrators -> Remove
- compmgmt.msc -> Local Users and Groups -> Users -> postgres -> Member of -> Add… -> Power Users -> OK
- Installed HM2 -> created db successfully
- Restarted computer -> HM2 runs properly (i.e. just to check postgresql service starts automatically)
*O Windows 10 Home Edition não possui a opção Usuários e Grupos Locais, e essa é a razão pela qual você não consegue ver isso no Gerenciamento do Computador. Você pode usar Contas de Usuário pressionando
netplwize pressionando OK
I had also this problem but the solution was not so easy as described above – always got the error.
Solution required for my machine the following steps:
2.)Delete the postgres user if it still exists :
net user postgres /delete
3.) Create the postgres user with a password you can remember:
net user /add postgres <password>
4.) Add the postgres user to the Administrators group:
net localgroup administrators postgres /add
5.) Add the postgres user to the Power Users group
net localgroup "power users" postgres /add
6.) Run a command window as the postgres user:
runas /user:postgres cmd.exe
7.) Run the install file from within the command window.
->his should run the installation successfully.
8.)Remove the postgres user from the Administrators group.
net localgroup administrators postgres /delete