ユーザ用ツール

サイト用ツール


serverapps:db:postgresql:command

差分

このページの2つのバージョン間の差分を表示します。

この比較画面へのリンク

次のリビジョン
前のリビジョン
serverapps:postgresql:command [2019/02/11 04:38] – 作成 hayashiserverapps:db:postgresql:command [2021/05/11 02:30] (現在) – ↷ serverapps:postgresql:command から serverapps:db:postgresql:command へページを移動しました。 hayashi
行 16: 行 16:
 テーブル構造の表示 テーブル構造の表示
   \d テーブル名;   \d テーブル名;
 +
 +===== ユーザー権限 =====
 +
 +現在のユーザー(Role)を表示
 +  select current_user;
 +
 +ユーザー(Role)の一覧を表示
 +  \du
 +  
 +ユーザー情報一覧を表示
 +  select * from pg_user;
 +
 +ユーザー (Role)に権限を付与
 +  grant select, insert, update, delete on <TABLE_NAME> to <USER_NAME>;
 +
 +ユーザー (Role)に権限を剥奪
 +  revoke select, insert, update, delete on <TABLE_NAME> from <USER_NAME>;
 +
 +ユーザーの切り替え
 +  \connect - <USER_NAME>
 +
 +スーパーユーザーへ変更
 +  alter role <USER_NAME> with creatural superuser;
 +
 +スーパーユーザー権限剥奪
 +  alter role <USER_NAME> with creatural nosuperuser;
 +
 +
serverapps/db/postgresql/command.1549859937.txt.gz · 最終更新: 2019/02/11 04:38 by hayashi