Why is a table showing up twice in pg_class? I am attempting to run a PostgreSQL statement to query approximate table size count estimate using the following statement:
SELECT reltuples as approximate_row_count FROM pg_class WHERE relname = 'table_name';

ref: Count estimate (PostgreSQL | Wiki)
However, my query is returning two rows, one with a size and one with zero.
Why?
Turns out I had the same table (same name) within two different schemas.  So each had an entry in pg_class.
Work around from the wiki page is SELECT * FROM pg_class WHERE oid = 'schema_name.table_name'::regclass;