How to add a user to PostgreSQL in Windows?

前端 未结 4 1576
不知归路
不知归路 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 12:16

    In pgadmin you can create a new "Login Role" and name it Eric and give it permissions graphically, or from command line you can do something like this

    psql -U postgres -c "CREATE ROLE Eric LOGIN NOSUPERUSER INHERIT CREATEDB CREATEROLE;" mydb
    

    see http://developer.postgresql.org/pgdocs/postgres/sql-createrole.html for information on the CREATE ROLE options.

提交回复
热议问题