【PostgreSQL】データベース一覧を確認する
\lコマンドでデータベース一覧を確認する PostgreSQLでデータベース一覧を確認するには、psqlコマンドラインツールの\lコマンドを使う。
\l List of databases Name | Owner | Encoding | Locale Provider | Collate | Ctype | Locale | ICU Rules | Access privileges -----------+----------+----------+-----------------+------------+------------+--------+-----------+----------------------- analytics | postgres | UTF8 | libc | en_US.utf8 | en_US.utf8 | | | postgres | postgres | UTF8 | libc | en_US.utf8 | en_US.utf8 | | | reportdb | app_user | UTF8 | libc | en_US.utf8 | en_US.utf8 | | | shopdb | postgres | UTF8 | libc | en_US.utf8 | en_US.utf8 | | | template0 | postgres | UTF8 | libc | en_US.utf8 | en_US.utf8 | | | =c/postgres + | | | | | | | | postgres=CTc/postgres template1 | postgres | UTF8 | libc | en_US.utf8 | en_US.utf8 | | | =c/postgres + | | | | | | | | postgres=CTc/postgres (6 rows) \listと入力しても同じ結果になる。