How to add a user to PostgreSQL in Windows?

前端 未结 4 1580
不知归路
不知归路 2021-01-01 11:42

I\'m running PostgreSQL on mt Windows 7 machine. To run a database I type:

C:\\psql -Upostgres mydb

and this works, but it would be nice i

4条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-01 11:52

    Just to add more information. From official documentation: you can specify the user under which createuser utility logs in to postgres via environment variable:

    PGUSER
    

    One liner for powershell:

    & { $env:PGUSER="postgres"; .\createuser.exe Eric}
    

提交回复
热议问题