0
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

MySQLやPostgreSQLでデータベース一覧やテーブル一覧を抽出する方法

Posted at

MySQL,MariaDB,PostgreSQLなどで時々テーブル一覧やデータベース一覧をSQLで確認したいときの備忘録

MySQL

  • データベース一覧抽出SQL
show databases;
  • テーブル一覧抽出SQL
show tables;

PostgreSQL

  • データベース一覧抽出SQL
SELECT datname FROM pg_database;
  • テーブル一覧抽出SQL
SELECT
  relname as table_name 
FROM
  pg_stat_user_tables;

以上

0
2
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
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?