ユーザ用ツール

サイト用ツール


サイドバー

Index

はじめてのおつかい






DokuWiki整形記法


PlayGround



serverapps:db:postgresql:command

基本的なコマンド

データベース

データベース一覧の表示

\l

データベースの選択

\c データベース名

テーブル

テーブル一覧の表示

\dt;

テーブル構造の表示

\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.txt · 最終更新: 2021/05/11 11:30 by hayashi