<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/1.5.1.3" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: Reporting on disk space usage for PostgreSQL and MySQL databases</title>
	<link>http://www.summersault.com/community/weblog/2005/10/25/reporting-on-disk-space-usage-for-postgresql-and-mysql-databases.html</link>
	<description>The weblog for Summersault, LLC, a website development firm in Richmond, Indiana</description>
	<pubDate>Sun, 20 Jul 2008 19:11:36 +0000</pubDate>
	<generator>http://wordpress.org/?v=1.5.1.3</generator>

	<item>
		<title>by: Mark Stosberg</title>
		<link>http://www.summersault.com/community/weblog/2005/10/25/reporting-on-disk-space-usage-for-postgresql-and-mysql-databases.html#comment-522</link>
		<pubDate>Wed, 15 Mar 2006 20:53:26 +0000</pubDate>
		<guid>http://www.summersault.com/community/weblog/2005/10/25/reporting-on-disk-space-usage-for-postgresql-and-mysql-databases.html#comment-522</guid>
					<description>Since the &lt;a href=&quot;http://www.postgresql.org/docs/current/static/release-8-1.html&quot; rel=&quot;nofollow&quot;&gt;release of PostgreSQL 8.1&lt;/a&gt;, these functions are now built directly to PostgreSQL, although they have different names. See &lt;a href=&quot;http://www.postgresql.org/docs/8.1/interactive/functions-admin.html#FUNCTIONS-ADMIN-DBSIZE&quot; rel=&quot;nofollow&quot;&gt;the documentation&lt;/a&gt; for details. 


The query above would now be written as:


SELECT pg_database.datname,
pg_shadow.usename AS owner,
pg_database_size(pg_database.datname) AS size,
pg_size_pretty(pg_database_size(pg_database.datname)) AS pretty_size
FROM pg_database
JOIN pg_shadow ON pg_database.datdba = pg_shadow.usesysid;



To get the size of a single table use: 


SELECT pg_size_pretty( pg_total_relation_size('my_table_name_here') );
</description>
		<content:encoded><![CDATA[	<p>Since the <a href="http://www.postgresql.org/docs/current/static/release-8-1.html" rel="nofollow">release of PostgreSQL 8.1</a>, these functions are now built directly to PostgreSQL, although they have different names. See <a href="http://www.postgresql.org/docs/8.1/interactive/functions-admin.html#FUNCTIONS-ADMIN-DBSIZE" rel="nofollow">the documentation</a> for details. </p>
	<p>The query above would now be written as:</p>
	<p>SELECT pg_database.datname,<br />
pg_shadow.usename AS owner,<br />
pg_database_size(pg_database.datname) AS size,<br />
pg_size_pretty(pg_database_size(pg_database.datname)) AS pretty_size<br />
FROM pg_database<br />
JOIN pg_shadow ON pg_database.datdba = pg_shadow.usesysid;</p>
	<p>To get the size of a single table use: </p>
	<p>SELECT pg_size_pretty( pg_total_relation_size(&#8217;my_table_name_here&#8217;) );
</p>
]]></content:encoded>
				</item>
</channel>
</rss>
