Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Re: database row count




On 30/01/2008 15:10, Isaac Vetter wrote the following:
Dear Pg experts;

I'd like to get a (rough) count of the numbers of rows across all tables in a given database.

I understand that I could write a script to run count(*) on each table and then sum the counts. Is there an easier way, has someone already written this script?

Much Thanks,

Isaac Vetter

How about

SELECT relname, reltuples FROM pg_class WHERE relname IN (...);



Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group