X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 7D28DD1E0C7 for ; Fri, 20 Feb 2004 18:54:34 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 91219-08 for ; Fri, 20 Feb 2004 14:54:27 -0400 (AST) Received: from davinci.ethosmedia.com (server228.ethosmedia.com [209.128.84.228]) by svr1.postgresql.org (Postfix) with ESMTP id 84688D1E0BB for ; Fri, 20 Feb 2004 14:54:25 -0400 (AST) Received: from [63.195.55.98] (HELO 192.168.1.29) by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.0.2) with ESMTP id 4463372; Fri, 20 Feb 2004 10:55:34 -0800 From: Josh Berkus Reply-To: josh@agliodbs.com Organization: Aglio Database Solutions To: "David B" , Subject: Re: Row counts/data changes. Any catalog table that has this info? Date: Fri, 20 Feb 2004 10:53:36 -0800 User-Agent: KMail/1.5.4 References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200402201053.36242.josh@agliodbs.com> X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200402/312 X-Sequence-Number: 17002 David, > table_name #Rows > cust 1000 > order 5000 > order_detail 9500 If you're willing to live with some inaccuracy, do: SELECT relname, reltuples FROM pg_class WHERE relkind='r'; This count gets updated when you do a VACUUM, and is seldom 100% accurate; however, if you VACUUM regularly it will be within 5-10%. -- -Josh Berkus Aglio Database Solutions San Francisco