0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

PostgreSQL ロール追加と権限付与

0
Posted at

概要

PostgreSQL にロールを追加する方法です。

本記事でやること

  1. ロールを追加する
  2. 権限を付与する

実行環境

PostgreSQL 11.1
CentOS 7.6

操作手順

ロールの追加

CREATE ROLE <ロール名> WITH LOGIN PASSWORD '<パスワード>'

存在するDBに対して権限を付与

GRANT ALL PRIVILEGES ON DATABASE データベース名 TO ユーザ名 WITH GRANT OPTION;

以上で作成したロールで特定のDBを操作できる。

pg_hba.confをmd5認証にしていない場合は変更し、再起動する必要があります。

終わりに

ユーザのことをロールということを知りました。(すみませんただの感想です)

参考

PostgreSQLでユーザー(ロール)を追加してテーブルにアクセスする
https://qiita.com/wb773/items/248e6e083b2fe12e820a

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?