Received: from localhost (unknown [200.46.204.183]) by developer.postgresql.org (Postfix) with ESMTP id 144B02E0041 for ; Thu, 22 May 2008 21:56:50 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 75520-08 for ; Thu, 22 May 2008 21:56:14 -0300 (ADT) X-Greylist: delayed 23:38:30.237933 by SQLgrey-1.7.6 Received: from tyo202.gate.nec.co.jp (TYO202.gate.nec.co.jp [202.32.8.206]) by developer.postgresql.org (Postfix) with ESMTP id B00FC2E00CC for ; Thu, 22 May 2008 21:47:09 -0300 (ADT) Received: from mailgate3.nec.co.jp (mailgate54.nec.co.jp [10.7.69.197]) by tyo202.gate.nec.co.jp (8.13.8/8.13.4) with ESMTP id m4N0l4mT003005; Fri, 23 May 2008 09:47:04 +0900 (JST) Received: (from root@localhost) by mailgate3.nec.co.jp (8.11.7/3.7W-MAILGATE-NEC) id m4N0l4C25855; Fri, 23 May 2008 09:47:04 +0900 (JST) Received: from shoin.jp.nec.com (shoin.jp.nec.com [10.26.220.3]) by mailsv3.nec.co.jp (8.13.8/8.13.4) with ESMTP id m4N0l4DO020717; Fri, 23 May 2008 09:47:04 +0900 (JST) Received: from C07AUG23723 ([10.72.35.246] [10.72.35.246]) by mail.jp.nec.com with ESMTP; Fri, 23 May 2008 09:47:03 +0900 Message-Id: <003001c8bc6e$84c24dd0$f623480a@nsl.ad.nec.co.jp> From: "Duan Ligong" To: Cc: "Gerd Koenig" References: <004301c8b62b$b183e840$f623480a@nsl.ad.nec.co.jp> <00ba01c8bba8$5b402750$f623480a@nsl.ad.nec.co.jp> Subject: Re: ]To estimate the size of db Date: Fri, 23 May 2008 09:47:02 +0900 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="ISO-8859-1"; reply-type=response Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.3138 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.699 tagged_above=0 required=5 tests=AWL=0.000, MSOE_MID_WRONG_CASE=0.699 X-Spam-Level: X-Archive-Number: 200805/191 X-Sequence-Number: 29275 Hi, Gerd > perhaps you can go the way via some system functions like: Thank you very much and it's very helpful. Regards Duan > ## list tables and their size > SELECT relname AS table_name, > pg_size_pretty(pg_relation_size(oid)) AS table_sz, > pg_size_pretty(pg_total_relation_size(oid)) AS > total_sz > FROM pg_class > WHERE relkind = 'r' > ORDER BY pg_relation_size(oid) DESC; > > ## list db's and size > SELECT datname AS db_name, > pg_size_pretty(pg_database_size(oid)) AS db_size > FROM pg_database > ORDER BY pg_database_size(oid) DESC; > > > hope that helps......::GERD::...... > > Am 22.05.2008 um 03:08 schrieb Duan Ligong: > >> Hi, Scott >> >> Thanks for your reply. >> >>> There's also the old fashioned way: >> >> I mean I want to estimate the size of the space which the db will >> occupy. >> Now there is no db. >> >>> sudo su - postgres >>> cd $PGDATA # or wherever you point with -D on startup >>> du -sh . >> >> Regards >> Duan >> -- >> Duan Ligong >> TEL : 0561-75-1925-6201 >> 800-81-569-6201 >> E-Mail : l-duan@zd.cnes.jp.nec.com >> ----- Original Message ----- From: "Scott Marlowe" >> >> To: "Duan Ligong" >> Cc: >> Sent: Thursday, May 22, 2008 4:08 AM >> Subject: Re: [ADMIN] [Admin]To estimate the size of db >> >> >>> On Wed, May 14, 2008 at 7:33 PM, Duan Ligong >> duan@zd.cnes.jp.nec.com> wrote: >>>> >>>> Hi, all >>>> >>>> Is there a way to estimate the size of the space which a >>>> postgresql database >>>> occupies? or the max size of db? >>>> >>>> I know there are a lot of factors, such as the frequency >>>> of updating, data size, which affects the size of db and it seems >>>> difficult >>>> to estimate it precisely. >>> >>> There's also the old fashioned way: >>> >>> sudo su - postgres >>> cd $PGDATA # or wherever you point with -D on startup >>> du -sh . >>> >>> -- >>> Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) >>> To make changes to your subscription: >>> http://www.postgresql.org/mailpref/pgsql-admin >> >> >> -- >> Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) >> To make changes to your subscription: >> http://www.postgresql.org/mailpref/pgsql-admin