RubyPDF Blog bigdata How to Get the Row numbers of all tables in PostgreSQL Database

How to Get the Row numbers of all tables in PostgreSQL Database

SELECT schemaname,relname,n_live_tup 
  FROM pg_stat_user_tables 
  ORDER BY n_live_tup DESC;

Recently, I imported 25 Excels into PostgreSQL separate tables with R, after imported, I was told there existed two excel files with the same content, I forgot recording  the relationship between excel and table, so I found the SQL to help me detect the duplicated tables.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.