<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>object count &#8211; Database Research &amp; Development</title>
	<atom:link href="https://www.dbrnd.com/tag/object-count/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.dbrnd.com</link>
	<description>BIGData &#124; NoSQL &#124; MSSQL &#124; MySQL &#124; PostgreSQL</description>
	<lastBuildDate>Wed, 31 May 2017 03:14:43 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0.6</generator>
	<item>
		<title>PostgreSQL: Script to find the count of objects for each Database Schema</title>
		<link>https://www.dbrnd.com/2017/06/postgresql-script-to-find-the-count-of-objects-for-each-database-schema/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Wed, 07 Jun 2017 16:16:56 +0000</pubDate>
				<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[PostgreSQL DBA Script]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[object count]]></category>
		<category><![CDATA[plpgsql]]></category>
		<category><![CDATA[Postgres Query]]></category>
		<category><![CDATA[postgresql]]></category>
		<category><![CDATA[PostgreSQL Administrator]]></category>
		<category><![CDATA[PostgreSQL Error]]></category>
		<category><![CDATA[PostgreSQL Monitoring]]></category>
		<category><![CDATA[PostgreSQL Performance Tuning]]></category>
		<category><![CDATA[PostgreSQL Programming]]></category>
		<category><![CDATA[PostgreSQL Tips and Tricks]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=5371</guid>

					<description><![CDATA[In this post, I am sharing a script to find the total count of objects for each database schemas of PostgreSQL. If you Postgres DBA and want to do accounting on a number of total objects per schemas, you can use this script. Using this script, you can find different types of objects count like [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F06%2Fpostgresql-script-to-find-the-count-of-objects-for-each-database-schema%2F&amp;linkname=PostgreSQL%3A%20Script%20to%20find%20the%20count%20of%20objects%20for%20each%20Database%20Schema" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F06%2Fpostgresql-script-to-find-the-count-of-objects-for-each-database-schema%2F&amp;linkname=PostgreSQL%3A%20Script%20to%20find%20the%20count%20of%20objects%20for%20each%20Database%20Schema" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F06%2Fpostgresql-script-to-find-the-count-of-objects-for-each-database-schema%2F&amp;linkname=PostgreSQL%3A%20Script%20to%20find%20the%20count%20of%20objects%20for%20each%20Database%20Schema" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F06%2Fpostgresql-script-to-find-the-count-of-objects-for-each-database-schema%2F&amp;linkname=PostgreSQL%3A%20Script%20to%20find%20the%20count%20of%20objects%20for%20each%20Database%20Schema" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F06%2Fpostgresql-script-to-find-the-count-of-objects-for-each-database-schema%2F&amp;linkname=PostgreSQL%3A%20Script%20to%20find%20the%20count%20of%20objects%20for%20each%20Database%20Schema" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F06%2Fpostgresql-script-to-find-the-count-of-objects-for-each-database-schema%2F&amp;linkname=PostgreSQL%3A%20Script%20to%20find%20the%20count%20of%20objects%20for%20each%20Database%20Schema" title="Pocket" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F06%2Fpostgresql-script-to-find-the-count-of-objects-for-each-database-schema%2F&#038;title=PostgreSQL%3A%20Script%20to%20find%20the%20count%20of%20objects%20for%20each%20Database%20Schema" data-a2a-url="https://www.dbrnd.com/2017/06/postgresql-script-to-find-the-count-of-objects-for-each-database-schema/" data-a2a-title="PostgreSQL: Script to find the count of objects for each Database Schema"></a></p><p>In this post, I am sharing a script to find the total count of objects for each database schemas of PostgreSQL.<br />
If you Postgres DBA and want to do accounting on a number of total objects per schemas, you can use this script.</p>
<p>Using this script, you can find different types of objects count like table, view, index, sequence.</p>
<pre class="crayon-plain-tag">SELECT
	n.nspname as schema_name
	,CASE c.relkind
	   WHEN 'r' THEN 'table'
	   WHEN 'v' THEN 'view'
	   WHEN 'i' THEN 'index'
	   WHEN 'S' THEN 'sequence'
	   WHEN 's' THEN 'special'
	END as object_type
	,count(1) as object_count
FROM pg_catalog.pg_class c
LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace
WHERE c.relkind IN ('r','v','i','S','s')
GROUP BY  n.nspname,
	CASE c.relkind
	   WHEN 'r' THEN 'table'
	   WHEN 'v' THEN 'view'
	   WHEN 'i' THEN 'index'
	   WHEN 'S' THEN 'sequence'
	   WHEN 's' THEN 'special'
	END
ORDER BY n.nspname,
	CASE c.relkind
	   WHEN 'r' THEN 'table'
	   WHEN 'v' THEN 'view'
	   WHEN 'i' THEN 'index'
	   WHEN 'S' THEN 'sequence'
	   WHEN 's' THEN 'special'
	END;</pre> </p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
