<?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>pg_get_userbyid &#8211; Database Research &amp; Development</title>
	<atom:link href="https://www.dbrnd.com/tag/pg_get_userbyid/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>Fri, 15 Sep 2017 10:37:48 +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 Table and Column without comment or description</title>
		<link>https://www.dbrnd.com/2015/09/postgresql-script-to-find-table-and-column-without-comment-or-description/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Thu, 24 Sep 2015 16:38:42 +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[pg_attribute]]></category>
		<category><![CDATA[pg_class]]></category>
		<category><![CDATA[pg_description]]></category>
		<category><![CDATA[pg_get_userbyid]]></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 Programming]]></category>
		<category><![CDATA[PostgreSQL Tips and Tricks]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=715</guid>

					<description><![CDATA[In this post, I am sharing a script to find the table and column, which are not associated with any comment or description of PostgreSQL. Self-documentation is a most important thing for every developer and organization. In our company, We are very strictly following this rule as a database development standard in which we have [&#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%2F2015%2F09%2Fpostgresql-script-to-find-table-and-column-without-comment-or-description%2F&amp;linkname=PostgreSQL%3A%20Script%20to%20Find%20Table%20and%20Column%20without%20comment%20or%20description" 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%2F2015%2F09%2Fpostgresql-script-to-find-table-and-column-without-comment-or-description%2F&amp;linkname=PostgreSQL%3A%20Script%20to%20Find%20Table%20and%20Column%20without%20comment%20or%20description" 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%2F2015%2F09%2Fpostgresql-script-to-find-table-and-column-without-comment-or-description%2F&amp;linkname=PostgreSQL%3A%20Script%20to%20Find%20Table%20and%20Column%20without%20comment%20or%20description" 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%2F2015%2F09%2Fpostgresql-script-to-find-table-and-column-without-comment-or-description%2F&amp;linkname=PostgreSQL%3A%20Script%20to%20Find%20Table%20and%20Column%20without%20comment%20or%20description" 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%2F2015%2F09%2Fpostgresql-script-to-find-table-and-column-without-comment-or-description%2F&amp;linkname=PostgreSQL%3A%20Script%20to%20Find%20Table%20and%20Column%20without%20comment%20or%20description" 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%2F2015%2F09%2Fpostgresql-script-to-find-table-and-column-without-comment-or-description%2F&amp;linkname=PostgreSQL%3A%20Script%20to%20Find%20Table%20and%20Column%20without%20comment%20or%20description" 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%2F2015%2F09%2Fpostgresql-script-to-find-table-and-column-without-comment-or-description%2F&#038;title=PostgreSQL%3A%20Script%20to%20Find%20Table%20and%20Column%20without%20comment%20or%20description" data-a2a-url="https://www.dbrnd.com/2015/09/postgresql-script-to-find-table-and-column-without-comment-or-description/" data-a2a-title="PostgreSQL: Script to Find Table and Column without comment or description"></a></p><p>In this post, I am sharing a script to find the table and column, which are not associated with any comment or description of PostgreSQL.</p>
<p>Self-documentation is a most important thing for every developer and organization.<br />
In our company, We are very strictly following this rule as a database development standard in which we have to write a comment or description for every table and column.</p>
<blockquote><p>You can also manage this description using different UML tools.<br />
But better to other tools, we should write in the database so whenever you create a database diagram, comment or description added automatically.</p>
<p>The Humans are doing a mistake, so sometimes I have to find such a list objects which didn&#8217;t associate with any comment or description.</p></blockquote>
<p>I filtered below query by giving User_Name in WHERE clause, so if you want for all users, you should remove this filter. </p>
<p><strong>Find Table without comment.</strong></p>
<pre class="crayon-plain-tag">SELECT 
	pg_get_userbyid(pc.relowner)AS ObjectOwner
	,pc.relname AS TableName
	,pd.description AS Comment
FROM pg_class AS pc
LEFT OUTER JOIN pg_description AS pd 
	ON (pc.oid = pd.objoid)
WHERE pg_get_userbyid(pc.relowner) ='User_Name'
	AND pc.relkind = 'r'
	AND pd.description IS NULL;</pre> </p>
<p><strong>Find Column without comment. </strong></p>
<pre class="crayon-plain-tag">SELECT 
	pg_get_userbyid(pc.relowner) AS ObjectOwner
	,pc.relname AS TableName
	,pa.attname AS ColumnName
	,pd.description AS Comment
FROM pg_attribute AS pa
JOIN pg_class AS pc 
	ON (pa.attrelid = pc.oid)
LEFT OUTER JOIN pg_description AS pd 
	ON (pc.oid = pd.objoid AND pa.attnum = pd.objsubid)
WHERE pg_get_userbyid(pc.relowner) ='User_Name'
	AND pc.relkind = 'r'
	AND pd.description IS NULL
	AND pa.attnum &gt; 0
ORDER BY pa.attname;</pre> </p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
