How do you find the row count for all your tables in Postgres?

From: Nithya Soman <nithya(at)quintetsolutions(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: How do you find the row count for all your tables in Postgres?
Date: 2014-04-07 09:46:18
Message-ID: CAJG8ayAdqZEQ9XVnrKr6UpfV71hrN-ZEEje4AD=E6genzCKC9A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi

How can we find the total row count for all db tables in psql version
7.4.3 ??

The query which worked fine in psql 9.2 version is :
SELECT schemaname,relname,n_live_tup FROM pg_stat_user_tables ORDER BY
n_live_tup DESC.

But same query throws error as 'ERROR: column "n_live_tup" does not exist'
in psql 7.4.30. Could you please provide a valid query to get row count for
all db tables in psql 7.4.3 ?

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Albe Laurenz 2014-04-07 09:50:16 Re: Initial queries of day slow
Previous Message Atri Sharma 2014-04-07 09:41:27 Re: Initial queries of day slow