「Postgres」ユーザ作成、ロールを変更するコマンド

ユーザを追加し、ロール一覧を確認
postgres=# create user manuser1 with password 'manuser1pwd’;
CREATE ROLE
postgres=# create user manuser2 with password 'manuser2pwd’;
CREATE ROLE
-bash-4.2$ psql
psql (9.2.18)
“help" でヘルプを表示します.

postgres=# \du
manuser1にスーパーユーザ権限を付与する ALTER ROLEを使って、manuser1にスーパーユーザ権限を付与しました。
postgres=# ALTER ROLE manuser1 WITH SUPERUSER;
ALTER ROLE
postgres=# \du

DataBase

Posted by arkgame