* PostgreSQLのユーザ管理 [#v12b02a6]

** システムデータベースにログイン [#o08ade0e]
 psql template1

** 存在するユーザリストの確認 [#pe0c0bcd]
 SELECT * from pg_user;
 SELCT * from pg_shadow;

** 今ログインに使ってるユーザの確認 [#y20e2014]
 select current_user, session_user;

** パスワード付きのユーザ作成 [#a456aed7]
 CREATE USER name PASSWORD 'string'
 ALTER USER name PASSWORD 'string'
- ALTER USER: http://www.postgresql.jp/document/pg746doc/html/sql-alteruser.html
- CREATE USER: http://www.postgresql.jp/document/pg746doc/html/sql-createuser.html

パスワードを使う場合は、pg_hba.confでauthentication-methodをpasswordなどにすること。trustでは、パスワードを設定しても意味をなさない。

トップ   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS