Skip to content

Instantly share code, notes, and snippets.

@chokkoyamada
Last active February 13, 2020 05:25
Show Gist options
  • Save chokkoyamada/40cf12308037ccb0a14c90fdef1041f5 to your computer and use it in GitHub Desktop.
Save chokkoyamada/40cf12308037ccb0a14c90fdef1041f5 to your computer and use it in GitHub Desktop.
PostgreSQL コマンド

データベースのリスト

\l

テーブルのリスト

\dt

スキーマ内のテーブルリストを表示

\dt testschema.*

スキーマの表示

\dn

データベースの切り替え(use mydb)

\c mydb

スキーマ検索パスを表示

mydb=> show search_path;
   search_path
-----------------
 "$user", public

ユーザー(ロール)一覧

\du

指定したロール(ユーザー)をロール作成可にする

alter role nile createrole;

【初心者向け】PostgreSQLのロールについて分かり易く解説 https://eng-entrance.com/postgresql-role

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment