- 追加された行はこの色です。
- 削除された行はこの色です。
* PostgreSQLのユーザ管理 [#v12b02a6]
* ユーザ作成・パスワード変更 [#v12b02a6]
** システムデータベースにログイン [#o08ade0e]
psql template1
** 存在するユーザリストの確認 [#pe0c0bcd]
SELECT * from pg_user;
SELCT * from pg_shadow;
** 今ログインに使ってるユーザの確認 [#y20e2014]
select current_user, session_user;
** パスワード付きのユーザ作成・パスワードの変更 [#a456aed7]
CREATE USER taro WITH PASSWORD 'mypass'
ALTER USER taro WITH PASSWORD 'mypass'
- CREATE ROLE: http://www.postgresql.jp/document/8.3/html/sql-createrole.html
- ALTER USER: http://www.postgresql.jp/document/pg837doc/html/sql-alteruser.html
- CREATE USER: http://www.postgresql.jp/document/pg837doc/html/sql-createuser.html
- パスワードを使う場合は、pg_hba.confでauthentication-methodをpasswordなどにすること。trustでは、パスワードを設定しても意味をなさない。
*** 注意 [#y05e327d]
パスワードを使う場合は、pg_hba.confでauthentication-methodをpasswordなどにすること。trustでは、パスワードを設定しても意味をなさない。
** ユーザ削除 [#q143881c]
*** dropuserコマンド [#sf22a2b2]
http://www.postgresql.jp/document/9.3/html/app-dropuser.html