Re: Calculating database sizes using a script

From: Ireneusz Pluta <ipluta(at)wp(dot)pl>
To: Machiel Richards <machielr(at)rdc(dot)co(dot)za>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Calculating database sizes using a script
Date: 2010-03-23 14:53:50
Message-ID: 4BA8D5FE.4070208@wp.pl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<br>
<br>
Machiel Richards pisze:
<blockquote cite="mid:00b001caca68$74335090$5c99f1b0$(at)co(dot)za" type="cite">
<div class="Section1"><br>
<p class="MsoNormal">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Due to security restrictions I
am not yet
able to use pgadmin / pgphpadmin and need to manually calculate this
using &#8216;SELECT
pg_size_pretty(pg_database_size(''));&#8217;<o:p></o:p></p>
<p class="MsoNormal"><o:p></o:p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Is there a way of
running this in a script
for each database in the instance without having to manually type in
each
database name?<o:p></o:p></p>
</div>
</blockquote>
<small><font face="Courier New, Courier, monospace">select
pg_size_pretty(pg_database_size(datname)), datname from
pg_catalog.pg_database ;</font><br>
</small>
</body>
</html>

Attachment Content-Type Size
unknown_filename text/html 1.1 KB

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Krithinarayanan Ganesh Kumar 2010-03-24 12:06:08 Select query order
Previous Message Little, Douglas 2010-03-23 14:30:55 Re: string functions and operators