Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1eluBx-0000bs-Np for pgsql-admin@arkaria.postgresql.org; Wed, 14 Feb 2018 10:21:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eluBw-00029M-QE for pgsql-admin@arkaria.postgresql.org; Wed, 14 Feb 2018 10:21:32 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eluBw-00029B-F9 for pgsql-admin@lists.postgresql.org; Wed, 14 Feb 2018 10:21:32 +0000 Received: from mx2.mailbox.org ([80.241.60.215]) by makus.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1eluBs-0005i5-Ap for pgsql-admin@postgresql.org; Wed, 14 Feb 2018 10:21:31 +0000 Received: from smtp1.mailbox.org (smtp1.mailbox.org [80.241.60.240]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx2.mailbox.org (Postfix) with ESMTPS id 0332340EBB; Wed, 14 Feb 2018 11:21:23 +0100 (CET) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp1.mailbox.org ([80.241.60.240]) by spamfilter01.heinlein-hosting.de (spamfilter01.heinlein-hosting.de [80.241.56.115]) (amavisd-new, port 10030) with ESMTP id blTk9F5v30rZ; Wed, 14 Feb 2018 11:21:22 +0100 (CET) Message-ID: <1518603681.2402.0.camel@cybertec.at> Subject: Re: Calculation of Database Size in postgres From: Laurenz Albe To: pavan95 , pgsql-admin@postgresql.org Date: Wed, 14 Feb 2018 11:21:21 +0100 In-Reply-To: <1518603470895-0.post@n3.nabble.com> References: <1518603470895-0.post@n3.nabble.com> Organization: Cybertec Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk pavan95 wrote: > In postgres for knowing the size of a database we generally use the system > administration function "pg_database_size('database_name')". > > I am curious to know how does this calculate internally from the pages(free > pages/fragmented pages/full pages) stored in the disk? It just adds up the sizes of the files that make up the database. Yours, Laurenz Albe