Skip to content

Instantly share code, notes, and snippets.

@smd877
Created October 12, 2012 07:57
Show Gist options
  • Save smd877/3877864 to your computer and use it in GitHub Desktop.
Save smd877/3877864 to your computer and use it in GitHub Desktop.
PostgreSQLでDBの各テーブルのレコード数を確認したいとき
SELECT T2.relname
, T2.reltuples
FROM pg_stat_user_tables AS T1
INNER JOIN pg_class AS T2
ON T1.relname = T2.relname
ORDER BY T2.relname;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment