* ユーザ作成・パスワード変更 [#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
*** 注意 [#y05e327d]
パスワードを使う場合は、pg_hba.confでauthentication-methodをpasswordなどにすること。trustでは、パスワードを設定しても意味をなさない。

** ユーザ削除 [#q143881c]
*** dropuserコマンド [#sf22a2b2]
http://www.postgresql.jp/document/9.3/html/app-dropuser.html



トップ   編集 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS