0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

初めに

Qiita Engineer Festa 2024に参加中。完走目指してます。
他のメタコマンドについては以下から読んでください。

\dnとは

スキーマ(名前空間)の一覧を表示します。 patternを指定すると、パターンに名前がマッチするスキーマのみが表示されます。 デフォルトではユーザが作成したオブジェクトのみが表示されます。 パターンまたはS修飾子を追加すると、システムオブジェクトが表示に追加されます。 コマンド名の後に+を付加すると、各オブジェクトに関連付けられている権限と説明が(存在すれば)表示されます。

\dnについて

試してみた

まずは\dnを使う

postgres=# \dn
        スキーマ一覧
  名前  |      所有者       
--------+-------------------
 public | pg_database_owner
 test   | daichi
(2 )

特定のスキーマを指定

postgres=# \dn public
        スキーマ一覧
  名前  |      所有者       
--------+-------------------
 public | pg_database_owner
(1 )

詳細を確認する

postgres=# \dn+
                                         スキーマ一覧
  名前  |      所有者       |              アクセス権限              |          説明          
--------+-------------------+----------------------------------------+------------------------
 public | pg_database_owner | pg_database_owner=UC/pg_database_owner+| standard public schema
        |                   | =U/pg_database_owner                   | 
 test   | daichi            |                                        | 
(2 )

まとめ

スキーマを確認することは日々の業務ではあまり使ってこなかったけど、権限を確認するのには利用できそう

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?