<?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>PostgreSQL 9.6 &#8211; Database Research &amp; Development</title>
	<atom:link href="https://www.dbrnd.com/tag/postgresql-9-6/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>Sun, 02 Jul 2017 17:05:23 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0.4</generator>
	<item>
		<title>PostgreSQL: How to uninstall PostgreSQL 9.6 from Ubuntu</title>
		<link>https://www.dbrnd.com/2017/07/postgresql-how-to-uninstall-postgresql-9-6-from-ubuntu-remove-purge/</link>
					<comments>https://www.dbrnd.com/2017/07/postgresql-how-to-uninstall-postgresql-9-6-from-ubuntu-remove-purge/#comments</comments>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Fri, 14 Jul 2017 16:16:52 +0000</pubDate>
				<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[plpgsql]]></category>
		<category><![CDATA[Postgres Query]]></category>
		<category><![CDATA[postgresql]]></category>
		<category><![CDATA[PostgreSQL 9.6]]></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>
		<category><![CDATA[Uninstall]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=5607</guid>

					<description><![CDATA[In this post, I am sharing necessary steps to remove or uninstall PostgreSQL 9.6 from Ubuntu OS. Yesterday, I was testing a few latest extensions in my PostgreSQL test server, and unfortunately, PostgreSQL Server corrupted. As this is my test server, so simply I uninstalled full setup and again installed it. PostgreSQL: How to Install [&#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%2F07%2Fpostgresql-how-to-uninstall-postgresql-9-6-from-ubuntu-remove-purge%2F&amp;linkname=PostgreSQL%3A%20How%20to%20uninstall%20PostgreSQL%209.6%20from%20Ubuntu" 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%2F07%2Fpostgresql-how-to-uninstall-postgresql-9-6-from-ubuntu-remove-purge%2F&amp;linkname=PostgreSQL%3A%20How%20to%20uninstall%20PostgreSQL%209.6%20from%20Ubuntu" 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%2F07%2Fpostgresql-how-to-uninstall-postgresql-9-6-from-ubuntu-remove-purge%2F&amp;linkname=PostgreSQL%3A%20How%20to%20uninstall%20PostgreSQL%209.6%20from%20Ubuntu" 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%2F07%2Fpostgresql-how-to-uninstall-postgresql-9-6-from-ubuntu-remove-purge%2F&amp;linkname=PostgreSQL%3A%20How%20to%20uninstall%20PostgreSQL%209.6%20from%20Ubuntu" 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%2F07%2Fpostgresql-how-to-uninstall-postgresql-9-6-from-ubuntu-remove-purge%2F&amp;linkname=PostgreSQL%3A%20How%20to%20uninstall%20PostgreSQL%209.6%20from%20Ubuntu" 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%2F07%2Fpostgresql-how-to-uninstall-postgresql-9-6-from-ubuntu-remove-purge%2F&amp;linkname=PostgreSQL%3A%20How%20to%20uninstall%20PostgreSQL%209.6%20from%20Ubuntu" 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%2F07%2Fpostgresql-how-to-uninstall-postgresql-9-6-from-ubuntu-remove-purge%2F&#038;title=PostgreSQL%3A%20How%20to%20uninstall%20PostgreSQL%209.6%20from%20Ubuntu" data-a2a-url="https://www.dbrnd.com/2017/07/postgresql-how-to-uninstall-postgresql-9-6-from-ubuntu-remove-purge/" data-a2a-title="PostgreSQL: How to uninstall PostgreSQL 9.6 from Ubuntu"></a></p><p>In this post, I am sharing necessary steps to remove or uninstall PostgreSQL 9.6 from Ubuntu OS. Yesterday, I was testing a few latest extensions in my PostgreSQL test server, and unfortunately, PostgreSQL Server corrupted. </p>
<p>As this is my test server, so simply I uninstalled full setup and again installed it. </p>
<blockquote data-secret="ziXVyisNNU" class="wp-embedded-content"><p><a href="https://www.dbrnd.com/2017/01/postgresql-how-to-install-postgresql-9-6-on-ubuntu-16-04/">PostgreSQL: How to Install PostgreSQL 9.6 on Ubuntu 16.04?</a></p></blockquote>
<p><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  src="https://www.dbrnd.com/2017/01/postgresql-how-to-install-postgresql-9-6-on-ubuntu-16-04/embed/#?secret=ziXVyisNNU" data-secret="ziXVyisNNU" width="600" height="338" title="&#8220;PostgreSQL: How to Install PostgreSQL 9.6 on Ubuntu 16.04?&#8221; &#8212; Database Research &amp; Development" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></p>
<p><strong>Please check below commands which I applied to uninstalled PostgreSQL:</strong></p>
<p><strong>First check Postgres related folders:</strong></p>
<pre class="crayon-plain-tag">ubuntu@ip:~/anvesh$ dpkg -l | grep postgres</pre> </p>
<p><strong>Result:</strong> </p>
<pre class="crayon-plain-tag">ii  pgdg-keyring               2014.1                  all     keyring for apt.postgresql.org
ii  postgresql-9.6             9.6.1-2.pgdg14.04+1     amd64   object-relational SQL database, version 9.6 server
ii  postgresql-client-9.6      9.6.1-2.pgdg14.04+1     amd64   front-end programs for PostgreSQL 9.6
ii  postgresql-client-common   178.pgdg14.04+1         all     manager for multiple PostgreSQL client versions
ii  postgresql-common          178.pgdg14.04+1         all     PostgreSQL database-cluster manager
ii  postgresql-contrib-9.6     9.6.1-2.pgdg14.04+1     amd64   additional facilities for PostgreSQL</pre> </p>
<p><strong>Command to remove few postgres folders:</strong></p>
<pre class="crayon-plain-tag">ubuntu@ip:~/anvesh$ sudo apt-get --purge remove postgresql postgresql-doc</pre> </p>
<p><strong>Now check again Postgres related folders:</strong></p><pre class="crayon-plain-tag">ubuntu@ip:~/anvesh$ dpkg -l | grep postgres</pre><p> </p>
<p><strong>Result:</strong></p><pre class="crayon-plain-tag">ii  pgdg-keyring              2014.1                all    keyring for apt.postgresql.org
ii  postgresql-client-9.6     9.6.1-2.pgdg14.04+1   amd64  front-end programs for PostgreSQL 9.6
ii  postgresql-client-common  178.pgdg14.04+1       all    manager for multiple PostgreSQL client versions</pre><p>
<p><strong>Now remove all other pending folders:</strong></p>
<pre class="crayon-plain-tag">ubuntu@ip:~/anvesh$ sudo apt-get --purge remove postgresql postgresql-client-9.6 postgresql-common pgdg-keyring</pre> </p>
<p><strong>Now PostgreSQL is uninstalled so confirmt that PSQL is running or not:</strong></p>
<pre class="crayon-plain-tag">ubuntu@ip:~/anvesh$ psql
The program 'psql' is currently not installed. You can install it by typing:
sudo apt install postgresql-client-common</pre> </p>
<p><strong>Now check the Postgres service status:</strong></p>
<pre class="crayon-plain-tag">ubuntu@ip:~/anvesh$ sudo service postgresql status
● postgresql.service
   Loaded: not-found (Reason: No such file or directory)
   Active: inactive (dead)</pre>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbrnd.com/2017/07/postgresql-how-to-uninstall-postgresql-9-6-from-ubuntu-remove-purge/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
			</item>
		<item>
		<title>PostgreSQL 9.6: Introduced CROSSTABVIEW (pivot) in PSQL</title>
		<link>https://www.dbrnd.com/2017/04/postgresql-9-6-introduced-crosstabview-pivot-in-psql/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Wed, 12 Apr 2017 16:16:04 +0000</pubDate>
				<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[crosstab]]></category>
		<category><![CDATA[CROSSTABVIEW]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[Pivot]]></category>
		<category><![CDATA[plpgsql]]></category>
		<category><![CDATA[Postgres Query]]></category>
		<category><![CDATA[postgresql]]></category>
		<category><![CDATA[PostgreSQL 9.6]]></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>
		<category><![CDATA[psql]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=5020</guid>

					<description><![CDATA[In this post, I am sharing a new feature CROSSTABVIEW in PSQL of PostgreSQL 9.6. Many times we require data arrangement horizontally, instead of vertically. Something like we are doing in a spreadsheet where one element has a multiple child elements and require calculation horizontally for each group of items. Now, you can use CROSSTABVIEW [&#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%2F04%2Fpostgresql-9-6-introduced-crosstabview-pivot-in-psql%2F&amp;linkname=PostgreSQL%209.6%3A%20Introduced%20CROSSTABVIEW%20%28pivot%29%20in%20PSQL" 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%2F04%2Fpostgresql-9-6-introduced-crosstabview-pivot-in-psql%2F&amp;linkname=PostgreSQL%209.6%3A%20Introduced%20CROSSTABVIEW%20%28pivot%29%20in%20PSQL" 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%2F04%2Fpostgresql-9-6-introduced-crosstabview-pivot-in-psql%2F&amp;linkname=PostgreSQL%209.6%3A%20Introduced%20CROSSTABVIEW%20%28pivot%29%20in%20PSQL" 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%2F04%2Fpostgresql-9-6-introduced-crosstabview-pivot-in-psql%2F&amp;linkname=PostgreSQL%209.6%3A%20Introduced%20CROSSTABVIEW%20%28pivot%29%20in%20PSQL" 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%2F04%2Fpostgresql-9-6-introduced-crosstabview-pivot-in-psql%2F&amp;linkname=PostgreSQL%209.6%3A%20Introduced%20CROSSTABVIEW%20%28pivot%29%20in%20PSQL" 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%2F04%2Fpostgresql-9-6-introduced-crosstabview-pivot-in-psql%2F&amp;linkname=PostgreSQL%209.6%3A%20Introduced%20CROSSTABVIEW%20%28pivot%29%20in%20PSQL" 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%2F04%2Fpostgresql-9-6-introduced-crosstabview-pivot-in-psql%2F&#038;title=PostgreSQL%209.6%3A%20Introduced%20CROSSTABVIEW%20%28pivot%29%20in%20PSQL" data-a2a-url="https://www.dbrnd.com/2017/04/postgresql-9-6-introduced-crosstabview-pivot-in-psql/" data-a2a-title="PostgreSQL 9.6: Introduced CROSSTABVIEW (pivot) in PSQL"></a></p><p>In this post, I am sharing a new feature CROSSTABVIEW in PSQL of PostgreSQL 9.6. Many times we require data arrangement horizontally, instead of vertically. </p>
<p>Something like we are doing in a spreadsheet where one element has a multiple child elements and require calculation horizontally for each group of items.</p>
<p>Now, you can use CROSSTABVIEW in new PSQL for this kind of requirement.</p>
<p><strong>Below is a small demonstration of this:</strong></p>
<p><strong>Open a psql command line and create a below sample table:</strong></p>
<pre class="crayon-plain-tag">create table tbl_range as
select
    ('{a,b,c,d,e,f}'::text[])[1 + floor(random() * 6)] as data1
    ,('{g,h,i,j,k,l}'::text[])[1 + floor(random() * 6)] as data2
    ,random() * 1000 as randomnumber
from generate_series(1,10000);</pre> </p>
<p><strong>Execute below few SELECTs:</strong></p>
<pre class="crayon-plain-tag">select * from tbl_range;
select data1, data2, count(*) from tbl_range group by data1, data2;</pre> </p>
<p><strong>Now check sample SELECT with CROSSTABVIEW:</strong></p>
<pre class="crayon-plain-tag">select data1, data2, count(*) from tbl_range group by data1, data2 \crosstabview data1 data2 count;</pre> </p>
<p><strong>The result:</strong></p>
<pre class="crayon-plain-tag">dbrnd=# select data1, data2, count(*) from tbl_range group by data1, data2 \crosstabview data1 data2 count;
 data1 |  k  |  j  |  i  |  h  |  g  |  l
-------+-----+-----+-----+-----+-----+-----
 f     | 281 | 273 | 261 | 265 | 268 | 258
 a     | 288 | 293 | 278 | 293 | 248 | 279
 d     | 293 | 264 | 278 | 258 | 289 | 291
 c     | 272 | 276 | 292 | 287 | 263 | 281
 e     | 269 | 279 | 281 | 257 | 274 | 318
 b     | 289 | 270 | 301 | 295 | 247 | 291
(6 rows)</pre> </p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>PostgreSQL 9.6: Introduced pg_visibility module to examine visibility map</title>
		<link>https://www.dbrnd.com/2017/04/postgresql-9-6-introduced-pg_visibility-module-to-examine-visibility-map/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Tue, 11 Apr 2017 16:16:34 +0000</pubDate>
				<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[extension]]></category>
		<category><![CDATA[Free Space Map]]></category>
		<category><![CDATA[generate_series]]></category>
		<category><![CDATA[module]]></category>
		<category><![CDATA[pg_visibility]]></category>
		<category><![CDATA[plpgsql]]></category>
		<category><![CDATA[Postgres Query]]></category>
		<category><![CDATA[postgresql]]></category>
		<category><![CDATA[PostgreSQL 9.6]]></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>
		<category><![CDATA[visibility map]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=5016</guid>

					<description><![CDATA[If you don&#8217;t know what VM and FSM is, I would suggest to read below articles: PostgreSQL: What is Visibility Map (VM)? PostgreSQL: What is a Free Space Map (FSM)? PostgreSQL 9.6 introduced a pg_visibility module to get the visibility map information of your table, and it is also giving page level information. For removing [&#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%2F04%2Fpostgresql-9-6-introduced-pg_visibility-module-to-examine-visibility-map%2F&amp;linkname=PostgreSQL%209.6%3A%20Introduced%20pg_visibility%20module%20to%20examine%20visibility%20map" 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%2F04%2Fpostgresql-9-6-introduced-pg_visibility-module-to-examine-visibility-map%2F&amp;linkname=PostgreSQL%209.6%3A%20Introduced%20pg_visibility%20module%20to%20examine%20visibility%20map" 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%2F04%2Fpostgresql-9-6-introduced-pg_visibility-module-to-examine-visibility-map%2F&amp;linkname=PostgreSQL%209.6%3A%20Introduced%20pg_visibility%20module%20to%20examine%20visibility%20map" 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%2F04%2Fpostgresql-9-6-introduced-pg_visibility-module-to-examine-visibility-map%2F&amp;linkname=PostgreSQL%209.6%3A%20Introduced%20pg_visibility%20module%20to%20examine%20visibility%20map" 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%2F04%2Fpostgresql-9-6-introduced-pg_visibility-module-to-examine-visibility-map%2F&amp;linkname=PostgreSQL%209.6%3A%20Introduced%20pg_visibility%20module%20to%20examine%20visibility%20map" 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%2F04%2Fpostgresql-9-6-introduced-pg_visibility-module-to-examine-visibility-map%2F&amp;linkname=PostgreSQL%209.6%3A%20Introduced%20pg_visibility%20module%20to%20examine%20visibility%20map" 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%2F04%2Fpostgresql-9-6-introduced-pg_visibility-module-to-examine-visibility-map%2F&#038;title=PostgreSQL%209.6%3A%20Introduced%20pg_visibility%20module%20to%20examine%20visibility%20map" data-a2a-url="https://www.dbrnd.com/2017/04/postgresql-9-6-introduced-pg_visibility-module-to-examine-visibility-map/" data-a2a-title="PostgreSQL 9.6: Introduced pg_visibility module to examine visibility map"></a></p><p>If you don&#8217;t know what VM and FSM is, I would suggest to read below articles:</p>
<blockquote data-secret="pTZNKHe5td" class="wp-embedded-content"><p><a href="https://www.dbrnd.com/2016/10/postgresql-what-is-visibility-map-vm-table-mvcc-architecture/">PostgreSQL: What is Visibility Map (VM)?</a></p></blockquote>
<p><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  src="https://www.dbrnd.com/2016/10/postgresql-what-is-visibility-map-vm-table-mvcc-architecture/embed/#?secret=pTZNKHe5td" data-secret="pTZNKHe5td" width="600" height="338" title="&#8220;PostgreSQL: What is Visibility Map (VM)?&#8221; &#8212; Database Research &amp; Development" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></p>
<blockquote data-secret="uPHRViR537" class="wp-embedded-content"><p><a href="https://www.dbrnd.com/2016/10/postgresql-what-is-a-free-space-map-fsm-table-mvcc-architecture/">PostgreSQL: What is a Free Space Map (FSM)?</a></p></blockquote>
<p><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  src="https://www.dbrnd.com/2016/10/postgresql-what-is-a-free-space-map-fsm-table-mvcc-architecture/embed/#?secret=uPHRViR537" data-secret="uPHRViR537" width="600" height="338" title="&#8220;PostgreSQL: What is a Free Space Map (FSM)?&#8221; &#8212; Database Research &amp; Development" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></p>
<blockquote><p>PostgreSQL 9.6 introduced a pg_visibility module to get the visibility map information of your table, and it is also giving page level information.<br />
For removing fragmentation, and improve the query performance we should check the visibility map of our table. </p></blockquote>
<p>For that, you need to create a pg_visibility module in PostgreSQL 9.6 and use it.<br />
Previously, people are checking the suffix _vm files which associate with your relation. </p>
<p><strong>Check the below demonstration on how to use pg_visibility:</strong></p>
<p><strong>Create a pg_visibility extension:</strong></p>
<pre class="crayon-plain-tag">CREATE EXTENSION pg_visibility;</pre> </p>
<p><strong>Create a sample table with 10000 dummy records:</strong></p>
<pre class="crayon-plain-tag">CREATE TABLE tbl_checkvmap AS SELECT generate_series(1,10000) AS id;</pre> </p>
<p><strong>Check the visibility map:</strong></p>
<pre class="crayon-plain-tag">SELECT * FROM pg_visibility('tbl_checkvmap'::regclass);</pre> </p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>PostgreSQL 9.6: Introduced wait_event_type and wait_event new columns of pg_stat_activity</title>
		<link>https://www.dbrnd.com/2017/04/postgresql-9-6-introduced-wait_event_type-and-wait_event-new-columns-of-pg_stat_activity/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Mon, 10 Apr 2017 16:16:45 +0000</pubDate>
				<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[pg_stat_activity]]></category>
		<category><![CDATA[plpgsql]]></category>
		<category><![CDATA[Postgres Query]]></category>
		<category><![CDATA[postgresql]]></category>
		<category><![CDATA[PostgreSQL 9.6]]></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>
		<category><![CDATA[wait_event]]></category>
		<category><![CDATA[wait_event_type]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=5012</guid>

					<description><![CDATA[PostgreSQL 9.6 introduced new two columns of table pg_stat_activity. The columns are wait_event_type and wait_event. The column wait_event_type reports the type of event a backend is waiting for, and the wait_event which is the name of the event being waiting for. These both columns are very useful for finding a query event information. Please check [&#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%2F04%2Fpostgresql-9-6-introduced-wait_event_type-and-wait_event-new-columns-of-pg_stat_activity%2F&amp;linkname=PostgreSQL%209.6%3A%20Introduced%20wait_event_type%20and%20wait_event%20new%20columns%20of%20pg_stat_activity" 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%2F04%2Fpostgresql-9-6-introduced-wait_event_type-and-wait_event-new-columns-of-pg_stat_activity%2F&amp;linkname=PostgreSQL%209.6%3A%20Introduced%20wait_event_type%20and%20wait_event%20new%20columns%20of%20pg_stat_activity" 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%2F04%2Fpostgresql-9-6-introduced-wait_event_type-and-wait_event-new-columns-of-pg_stat_activity%2F&amp;linkname=PostgreSQL%209.6%3A%20Introduced%20wait_event_type%20and%20wait_event%20new%20columns%20of%20pg_stat_activity" 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%2F04%2Fpostgresql-9-6-introduced-wait_event_type-and-wait_event-new-columns-of-pg_stat_activity%2F&amp;linkname=PostgreSQL%209.6%3A%20Introduced%20wait_event_type%20and%20wait_event%20new%20columns%20of%20pg_stat_activity" 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%2F04%2Fpostgresql-9-6-introduced-wait_event_type-and-wait_event-new-columns-of-pg_stat_activity%2F&amp;linkname=PostgreSQL%209.6%3A%20Introduced%20wait_event_type%20and%20wait_event%20new%20columns%20of%20pg_stat_activity" 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%2F04%2Fpostgresql-9-6-introduced-wait_event_type-and-wait_event-new-columns-of-pg_stat_activity%2F&amp;linkname=PostgreSQL%209.6%3A%20Introduced%20wait_event_type%20and%20wait_event%20new%20columns%20of%20pg_stat_activity" 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%2F04%2Fpostgresql-9-6-introduced-wait_event_type-and-wait_event-new-columns-of-pg_stat_activity%2F&#038;title=PostgreSQL%209.6%3A%20Introduced%20wait_event_type%20and%20wait_event%20new%20columns%20of%20pg_stat_activity" data-a2a-url="https://www.dbrnd.com/2017/04/postgresql-9-6-introduced-wait_event_type-and-wait_event-new-columns-of-pg_stat_activity/" data-a2a-title="PostgreSQL 9.6: Introduced wait_event_type and wait_event new columns of pg_stat_activity"></a></p><p>PostgreSQL 9.6 introduced new two columns of table pg_stat_activity. The columns are wait_event_type and wait_event.</p>
<p>The column wait_event_type reports the type of event a backend is waiting for, and the wait_event which is the name of the event being waiting for. These both columns are very useful for finding a query event information.</p>
<p><strong>Please check small demonstration of this:</strong></p>
<p><strong>Create a sample table:</strong></p><pre class="crayon-plain-tag">CREATE TABLE tbl_students(rno int, name character varying(10));</pre><p>
<strong>Put your table in lock mode:</strong></p><pre class="crayon-plain-tag">BEGIN TRANSACTION;
LOCK tbl_students IN ACCESS EXCLUSIVE MODE;</pre><p>
<strong>Open a new query session, and try to insert a below record:</strong></p><pre class="crayon-plain-tag">INSERT INTO tbl_students VALUES (1,'Anvesh');</pre><p>
<strong>Open a new query session, and check the output of pg_stat_activity:</strong></p><pre class="crayon-plain-tag">SELECT query, wait_event_type, wait_event FROM pg_stat_activity</pre><p>
<img loading="lazy" decoding="async" class="alignnone wp-image-5014 size-full" title="PostgreSQL Stat Activity" src="https://www.dbrnd.com/wp-content/uploads/2017/04/PostgreSQLStatActivity.png" alt="PostgreSQL Stat Activity" width="731" height="135" srcset="https://www.dbrnd.com/wp-content/uploads/2017/04/PostgreSQLStatActivity.png 731w, https://www.dbrnd.com/wp-content/uploads/2017/04/PostgreSQLStatActivity-300x55.png 300w, https://www.dbrnd.com/wp-content/uploads/2017/04/PostgreSQLStatActivity-150x28.png 150w" sizes="auto, (max-width: 731px) 100vw, 731px" /></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>PostgreSQL 9.6: Introduced pg_config system view to paths and compilation details</title>
		<link>https://www.dbrnd.com/2017/04/postgresql-9-6-introduced-pg_config-system-view-to-paths-and-compilation-details/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Sat, 08 Apr 2017 16:16:16 +0000</pubDate>
				<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[pg_config]]></category>
		<category><![CDATA[plpgsql]]></category>
		<category><![CDATA[Postgres Query]]></category>
		<category><![CDATA[postgresql]]></category>
		<category><![CDATA[PostgreSQL 9.6]]></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=5005</guid>

					<description><![CDATA[PostgreSQL 9.6 came with lots of very useful features and new system views. I shared many articles on PostgreSQL 9.6 which you can get in PostgreSQL category. PostgreSQL 9.6 also introduced a new system view which is pg_config. Using this view, we can get the information like important paths, postgres compilation details. Query to pg_config: [&#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%2F04%2Fpostgresql-9-6-introduced-pg_config-system-view-to-paths-and-compilation-details%2F&amp;linkname=PostgreSQL%209.6%3A%20Introduced%20pg_config%20system%20view%20to%20paths%20and%20compilation%20details" 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%2F04%2Fpostgresql-9-6-introduced-pg_config-system-view-to-paths-and-compilation-details%2F&amp;linkname=PostgreSQL%209.6%3A%20Introduced%20pg_config%20system%20view%20to%20paths%20and%20compilation%20details" 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%2F04%2Fpostgresql-9-6-introduced-pg_config-system-view-to-paths-and-compilation-details%2F&amp;linkname=PostgreSQL%209.6%3A%20Introduced%20pg_config%20system%20view%20to%20paths%20and%20compilation%20details" 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%2F04%2Fpostgresql-9-6-introduced-pg_config-system-view-to-paths-and-compilation-details%2F&amp;linkname=PostgreSQL%209.6%3A%20Introduced%20pg_config%20system%20view%20to%20paths%20and%20compilation%20details" 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%2F04%2Fpostgresql-9-6-introduced-pg_config-system-view-to-paths-and-compilation-details%2F&amp;linkname=PostgreSQL%209.6%3A%20Introduced%20pg_config%20system%20view%20to%20paths%20and%20compilation%20details" 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%2F04%2Fpostgresql-9-6-introduced-pg_config-system-view-to-paths-and-compilation-details%2F&amp;linkname=PostgreSQL%209.6%3A%20Introduced%20pg_config%20system%20view%20to%20paths%20and%20compilation%20details" 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%2F04%2Fpostgresql-9-6-introduced-pg_config-system-view-to-paths-and-compilation-details%2F&#038;title=PostgreSQL%209.6%3A%20Introduced%20pg_config%20system%20view%20to%20paths%20and%20compilation%20details" data-a2a-url="https://www.dbrnd.com/2017/04/postgresql-9-6-introduced-pg_config-system-view-to-paths-and-compilation-details/" data-a2a-title="PostgreSQL 9.6: Introduced pg_config system view to paths and compilation details"></a></p><p>PostgreSQL 9.6 came with lots of very useful features and new system views.<br />
I shared many articles on PostgreSQL 9.6 which you can get in PostgreSQL category.</p>
<p>PostgreSQL 9.6 also introduced a new system view which is pg_config. Using this view, we can get the information like important paths, postgres compilation details.</p>
<p><strong>Query to pg_config:</strong></p><pre class="crayon-plain-tag">select name, setting from pg_config;</pre><p>
<strong>The example result is:</strong></p>
<p><img loading="lazy" decoding="async" class="alignleft wp-image-5006 size-full" title="pg_config" src="https://www.dbrnd.com/wp-content/uploads/2017/03/pg_config.png" alt="pg_config" width="1362" height="469" srcset="https://www.dbrnd.com/wp-content/uploads/2017/03/pg_config.png 1362w, https://www.dbrnd.com/wp-content/uploads/2017/03/pg_config-300x103.png 300w, https://www.dbrnd.com/wp-content/uploads/2017/03/pg_config-1024x353.png 1024w, https://www.dbrnd.com/wp-content/uploads/2017/03/pg_config-750x258.png 750w, https://www.dbrnd.com/wp-content/uploads/2017/03/pg_config-150x52.png 150w" sizes="auto, (max-width: 1362px) 100vw, 1362px" /></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>PostgreSQL 9.6: Introduced a pg_blocking_pids function to get blocking process id</title>
		<link>https://www.dbrnd.com/2017/04/postgresql-9-6-introduced-a-pg_blocking_pids-function-to-get-blocking-process-id/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Fri, 07 Apr 2017 16:16:27 +0000</pubDate>
				<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[block]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[dead lock]]></category>
		<category><![CDATA[pg_blocking_pids]]></category>
		<category><![CDATA[plpgsql]]></category>
		<category><![CDATA[Postgres Query]]></category>
		<category><![CDATA[postgresql]]></category>
		<category><![CDATA[PostgreSQL 9.6]]></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>
		<category><![CDATA[transaction]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=5003</guid>

					<description><![CDATA[PostgreSQL 9.6 introduced a pg_blocking_pids() to get a blocking process id of your running transaction. When multiple sessions are trying to access a table, and that table is locked. At that time, we need to find that blocking process id which blocked that table so that we can take necessary steps. Using pg_blocking_pids(), we can [&#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%2F04%2Fpostgresql-9-6-introduced-a-pg_blocking_pids-function-to-get-blocking-process-id%2F&amp;linkname=PostgreSQL%209.6%3A%20Introduced%20a%20pg_blocking_pids%20function%20to%20get%20blocking%20process%20id" 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%2F04%2Fpostgresql-9-6-introduced-a-pg_blocking_pids-function-to-get-blocking-process-id%2F&amp;linkname=PostgreSQL%209.6%3A%20Introduced%20a%20pg_blocking_pids%20function%20to%20get%20blocking%20process%20id" 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%2F04%2Fpostgresql-9-6-introduced-a-pg_blocking_pids-function-to-get-blocking-process-id%2F&amp;linkname=PostgreSQL%209.6%3A%20Introduced%20a%20pg_blocking_pids%20function%20to%20get%20blocking%20process%20id" 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%2F04%2Fpostgresql-9-6-introduced-a-pg_blocking_pids-function-to-get-blocking-process-id%2F&amp;linkname=PostgreSQL%209.6%3A%20Introduced%20a%20pg_blocking_pids%20function%20to%20get%20blocking%20process%20id" 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%2F04%2Fpostgresql-9-6-introduced-a-pg_blocking_pids-function-to-get-blocking-process-id%2F&amp;linkname=PostgreSQL%209.6%3A%20Introduced%20a%20pg_blocking_pids%20function%20to%20get%20blocking%20process%20id" 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%2F04%2Fpostgresql-9-6-introduced-a-pg_blocking_pids-function-to-get-blocking-process-id%2F&amp;linkname=PostgreSQL%209.6%3A%20Introduced%20a%20pg_blocking_pids%20function%20to%20get%20blocking%20process%20id" 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%2F04%2Fpostgresql-9-6-introduced-a-pg_blocking_pids-function-to-get-blocking-process-id%2F&#038;title=PostgreSQL%209.6%3A%20Introduced%20a%20pg_blocking_pids%20function%20to%20get%20blocking%20process%20id" data-a2a-url="https://www.dbrnd.com/2017/04/postgresql-9-6-introduced-a-pg_blocking_pids-function-to-get-blocking-process-id/" data-a2a-title="PostgreSQL 9.6: Introduced a pg_blocking_pids function to get blocking process id"></a></p><p>PostgreSQL 9.6 introduced a pg_blocking_pids() to get a blocking process id of your running transaction. </p>
<p>When multiple sessions are trying to access a table, and that table is locked. At that time, we need to find that blocking process id which blocked that table so that we can take necessary steps.</p>
<p>Using pg_blocking_pids(), we can get that head process id which is blocking other connections.</p>
<p><strong>Below is a full demonstration of this:</strong></p>
<p><strong>First, save your current process id:</strong></p>
<pre class="crayon-plain-tag">SELECT pg_backend_pid();
-- my process id is: 6720</pre> </p>
<p><strong>Create a sample table:</strong></p>
<pre class="crayon-plain-tag">CREATE TABLE tbl_students(rno int, name character varying(10));</pre> </p>
<p><strong>Put your table in lock mode:</strong></p>
<pre class="crayon-plain-tag">BEGIN TRANSACTION;
LOCK tbl_students IN ACCESS EXCLUSIVE MODE;</pre> </p>
<p><strong>Open a new session, and save process id for that session also:</strong></p>
<pre class="crayon-plain-tag">SELECT pg_backend_pid();
-- my process id is: 5936</pre> </p>
<p><strong>Now in that new session, try to insert below record:</strong><br />
Your result will be in waiting mode&#8230;</p>
<pre class="crayon-plain-tag">INSERT INTO tbl_students VALUES (1,'Anvesh');</pre> </p>
<p><strong>Open a third new session, and execute below command with process id of your second session:</strong></p>
<pre class="crayon-plain-tag">SELECT pg_blocking_pids(5936);</pre> </p>
<p><strong>The result is:</strong></p>
<pre class="crayon-plain-tag">pg_blocking_pids
--------------------
{6720}</pre> </p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>PostgreSQL: How to Install PostgreSQL 9.6 on Ubuntu 16.04?</title>
		<link>https://www.dbrnd.com/2017/01/postgresql-how-to-install-postgresql-9-6-on-ubuntu-16-04/</link>
					<comments>https://www.dbrnd.com/2017/01/postgresql-how-to-install-postgresql-9-6-on-ubuntu-16-04/#comments</comments>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Sun, 15 Jan 2017 12:19:45 +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[plpgsql]]></category>
		<category><![CDATA[Postgres]]></category>
		<category><![CDATA[Postgres Query]]></category>
		<category><![CDATA[postgresql]]></category>
		<category><![CDATA[PostgreSQL 9.6]]></category>
		<category><![CDATA[PostgreSQL Administrator]]></category>
		<category><![CDATA[PostgreSQL Error]]></category>
		<category><![CDATA[PostgreSQL Programming]]></category>
		<category><![CDATA[PostgreSQL Tips and Tricks]]></category>
		<category><![CDATA[psql]]></category>
		<category><![CDATA[su postgres]]></category>
		<category><![CDATA[Ubuntu 16.04]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=4326</guid>

					<description><![CDATA[&#160; PostgreSQL is a powerful, open source object-relational database system. It has more than 15 years of active development and a proven architecture that has earned it a strong reputation for reliability, data integrity, and correctness. &#160; I am going to share few steps to install PostgreSQL 9.6 on Ubuntu 16.04. First, check the version [&#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%2F01%2Fpostgresql-how-to-install-postgresql-9-6-on-ubuntu-16-04%2F&amp;linkname=PostgreSQL%3A%20How%20to%20Install%20PostgreSQL%209.6%20on%20Ubuntu%2016.04%3F" 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%2F01%2Fpostgresql-how-to-install-postgresql-9-6-on-ubuntu-16-04%2F&amp;linkname=PostgreSQL%3A%20How%20to%20Install%20PostgreSQL%209.6%20on%20Ubuntu%2016.04%3F" 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%2F01%2Fpostgresql-how-to-install-postgresql-9-6-on-ubuntu-16-04%2F&amp;linkname=PostgreSQL%3A%20How%20to%20Install%20PostgreSQL%209.6%20on%20Ubuntu%2016.04%3F" 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%2F01%2Fpostgresql-how-to-install-postgresql-9-6-on-ubuntu-16-04%2F&amp;linkname=PostgreSQL%3A%20How%20to%20Install%20PostgreSQL%209.6%20on%20Ubuntu%2016.04%3F" 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%2F01%2Fpostgresql-how-to-install-postgresql-9-6-on-ubuntu-16-04%2F&amp;linkname=PostgreSQL%3A%20How%20to%20Install%20PostgreSQL%209.6%20on%20Ubuntu%2016.04%3F" 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%2F01%2Fpostgresql-how-to-install-postgresql-9-6-on-ubuntu-16-04%2F&amp;linkname=PostgreSQL%3A%20How%20to%20Install%20PostgreSQL%209.6%20on%20Ubuntu%2016.04%3F" 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%2F01%2Fpostgresql-how-to-install-postgresql-9-6-on-ubuntu-16-04%2F&#038;title=PostgreSQL%3A%20How%20to%20Install%20PostgreSQL%209.6%20on%20Ubuntu%2016.04%3F" data-a2a-url="https://www.dbrnd.com/2017/01/postgresql-how-to-install-postgresql-9-6-on-ubuntu-16-04/" data-a2a-title="PostgreSQL: How to Install PostgreSQL 9.6 on Ubuntu 16.04?"></a></p><p><a href="https://www.dbrnd.com/wp-content/uploads/2016/04/elephant-kruger.jpg" rel="attachment wp-att-2263"><img loading="lazy" decoding="async" class="alignleft wp-image-2263 size-medium" title="PostgreSQL Elephant" src="https://www.dbrnd.com/wp-content/uploads/2016/04/elephant-kruger-300x218.jpg" alt="PostgreSQL Elephant" width="300" height="218" srcset="https://www.dbrnd.com/wp-content/uploads/2016/04/elephant-kruger-300x218.jpg 300w, https://www.dbrnd.com/wp-content/uploads/2016/04/elephant-kruger-150x109.jpg 150w, https://www.dbrnd.com/wp-content/uploads/2016/04/elephant-kruger.jpg 622w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a></p>
<p>&nbsp;</p>
<p><em><a href="http://www.postgresql.org/about/" target="_blank">PostgreSQL is a powerful,</a> open source object-relational database system. It has more than 15 years of active development and a proven architecture that has earned it a strong reputation for reliability, data integrity, and correctness.</em><br />
&nbsp;<br />
I am going to share few steps to install PostgreSQL 9.6 on Ubuntu 16.04.</p>
<p><strong>First, check the version of Ubuntu:</strong><br />
<pre class="crayon-plain-tag">lsb_release -sc</pre>
<strong>You need to add the latest PostgreSQL repository for the latest version, otherwise It will install old version. This is for trusty version.</strong><br />
<pre class="crayon-plain-tag">sudo add-apt-repository "deb https://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main"</pre>
<strong>Update and Install PostgreSQL 9.6:</strong><br />
<pre class="crayon-plain-tag">sudo apt-get update
sudo apt-get install postgresql-9.6</pre>
<strong>Default postgres super user and postgres database is created. You need to set a password for the postgres super user. </strong><br />
<pre class="crayon-plain-tag">ubuntu@:~$ sudo passwd postgres
Enter new UNIX password:****
Retype new UNIX password:****
passwd: password updated successfully</pre>
<strong>If service is not started, you can start the PostgreSQL service. </strong><br />
<pre class="crayon-plain-tag">sudo service postgresql start</pre>
<strong>Connect PostgreSQL server using postgres user:</strong><br />
<pre class="crayon-plain-tag">ubuntu@:~$ su postgres
Password:****</pre>
<strong>Create a sample database:</strong><br />
<pre class="crayon-plain-tag">createdb database_name</pre>
<strong>Connect to that database:</strong><br />
<pre class="crayon-plain-tag">psql -d database_name</pre>
<strong>Create a sample table:</strong><br />
<pre class="crayon-plain-tag">create table Test (rno integer);</pre>
<strong>Exit to database session:</strong><br />
<pre class="crayon-plain-tag">\q</pre>
<strong>Exit to PostgreSQL server:</strong><br />
<pre class="crayon-plain-tag">exit</pre>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbrnd.com/2017/01/postgresql-how-to-install-postgresql-9-6-on-ubuntu-16-04/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>PostgreSQL 9.6: Powerful Parallel Query Processing &#8211; Full Performance Test</title>
		<link>https://www.dbrnd.com/2016/11/postgresql-9-6-powerful-parallel-query-processing-full-performance-test-max_worker_processes-max_parallel_workers_per_gather/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Mon, 21 Nov 2016 18:02:01 +0000</pubDate>
				<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[Increase the Performance]]></category>
		<category><![CDATA[max_parallel_workers_per_gather]]></category>
		<category><![CDATA[max_worker_processes]]></category>
		<category><![CDATA[min_parallel_relation_size]]></category>
		<category><![CDATA[Parallel CPU Usage]]></category>
		<category><![CDATA[Parallel Query Processing]]></category>
		<category><![CDATA[parallel_setup_cost]]></category>
		<category><![CDATA[plpgsql]]></category>
		<category><![CDATA[Postgres Query]]></category>
		<category><![CDATA[postgresql]]></category>
		<category><![CDATA[PostgreSQL 9.6]]></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=3889</guid>

					<description><![CDATA[A most awaited feature, The Powerful Parallel Sequential Query Scan feature introduced in PostgreSQL 9.6. You can easily set the Parallel Sequential parameter&#8217;s value and can execute your queries 10 times faster. When we are talking about Parallel Sequential Scanning, in background multiple workers or CPU threads are responsible for executing one single query. In [&#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%2F2016%2F11%2Fpostgresql-9-6-powerful-parallel-query-processing-full-performance-test-max_worker_processes-max_parallel_workers_per_gather%2F&amp;linkname=PostgreSQL%209.6%3A%20Powerful%20Parallel%20Query%20Processing%20%E2%80%93%20Full%20Performance%20Test" 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%2F2016%2F11%2Fpostgresql-9-6-powerful-parallel-query-processing-full-performance-test-max_worker_processes-max_parallel_workers_per_gather%2F&amp;linkname=PostgreSQL%209.6%3A%20Powerful%20Parallel%20Query%20Processing%20%E2%80%93%20Full%20Performance%20Test" 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%2F2016%2F11%2Fpostgresql-9-6-powerful-parallel-query-processing-full-performance-test-max_worker_processes-max_parallel_workers_per_gather%2F&amp;linkname=PostgreSQL%209.6%3A%20Powerful%20Parallel%20Query%20Processing%20%E2%80%93%20Full%20Performance%20Test" 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%2F2016%2F11%2Fpostgresql-9-6-powerful-parallel-query-processing-full-performance-test-max_worker_processes-max_parallel_workers_per_gather%2F&amp;linkname=PostgreSQL%209.6%3A%20Powerful%20Parallel%20Query%20Processing%20%E2%80%93%20Full%20Performance%20Test" 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%2F2016%2F11%2Fpostgresql-9-6-powerful-parallel-query-processing-full-performance-test-max_worker_processes-max_parallel_workers_per_gather%2F&amp;linkname=PostgreSQL%209.6%3A%20Powerful%20Parallel%20Query%20Processing%20%E2%80%93%20Full%20Performance%20Test" 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%2F2016%2F11%2Fpostgresql-9-6-powerful-parallel-query-processing-full-performance-test-max_worker_processes-max_parallel_workers_per_gather%2F&amp;linkname=PostgreSQL%209.6%3A%20Powerful%20Parallel%20Query%20Processing%20%E2%80%93%20Full%20Performance%20Test" 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%2F2016%2F11%2Fpostgresql-9-6-powerful-parallel-query-processing-full-performance-test-max_worker_processes-max_parallel_workers_per_gather%2F&#038;title=PostgreSQL%209.6%3A%20Powerful%20Parallel%20Query%20Processing%20%E2%80%93%20Full%20Performance%20Test" data-a2a-url="https://www.dbrnd.com/2016/11/postgresql-9-6-powerful-parallel-query-processing-full-performance-test-max_worker_processes-max_parallel_workers_per_gather/" data-a2a-title="PostgreSQL 9.6: Powerful Parallel Query Processing – Full Performance Test"></a></p><h2>A most awaited feature, The Powerful Parallel Sequential Query Scan feature introduced in PostgreSQL 9.6.</h2>
<blockquote><p>You can easily set the Parallel Sequential parameter&#8217;s value and can execute your queries 10 times faster.<br />
When we are talking about Parallel Sequential Scanning, in background multiple workers or CPU threads are responsible for executing one single query.</p>
<p><img loading="lazy" decoding="async" class="alignright wp-image-3894 size-full" title="postgresql parallel query processing" src="https://www.dbrnd.com/wp-content/uploads/2016/11/PostgreSQLParallelQueryProcessing.png" alt="postgresqlparallelqueryprocessing" width="256" height="256" srcset="https://www.dbrnd.com/wp-content/uploads/2016/11/PostgreSQLParallelQueryProcessing.png 256w, https://www.dbrnd.com/wp-content/uploads/2016/11/PostgreSQLParallelQueryProcessing-150x150.png 150w" sizes="auto, (max-width: 256px) 100vw, 256px" /></p></blockquote>
<blockquote><p>In the PostgreSQL 9.6, You can change the Process Workers parameter value which is default 8. (Using max_worker_processes parameter)</p></blockquote>
<blockquote><p>
<strong>Important Note:</strong><br />
If you want to increase Parallel Process Worker parameter value, You should make sure about your total CPU usage because More Parallel Process Worker required More CPU.<br />
Once you change the parameter value, You must restart the PostgreSQL service.</p></blockquote>
<blockquote data-secret="t1RdDyDsMt" class="wp-embedded-content"><p><a href="https://www.dbrnd.com/2016/11/database-theory-what-is-parallel-query-processing-parallel-database-system/">Database Theory: What is Parallel Query Processing (Parallel Database System)?</a></p></blockquote>
<p><iframe loading="lazy" class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  src="https://www.dbrnd.com/2016/11/database-theory-what-is-parallel-query-processing-parallel-database-system/embed/#?secret=t1RdDyDsMt" data-secret="t1RdDyDsMt" width="600" height="338" title="&#8220;Database Theory: What is Parallel Query Processing (Parallel Database System)?&#8221; &#8212; Database Research &amp; Development" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe><br />
<strong>The details about new Parallel Sequential Parameters:</strong></p>
<blockquote><p><strong>max_worker_processes:</strong> Total number of background workers limited by this parameter. (Default: 8)<br />
<strong>max_parallel_workers_per_gather:</strong> Total number of workers that can assist a sequential scan.<br />
<strong>parallel_setup_cost:</strong> used to estimate the cost of instantiate a worker.<br />
<strong>min_parallel_relation_size:</strong> You can define the minimum size of the relation and only those relations will consider for additional workers.<br />
<strong>parallel_tuple_cost:</strong> used to estimate the cost of transferring a tuple from one worker to another.</p></blockquote>
<p><strong>Below is a full demonstration of this:</strong></p>
<blockquote><p>Prepared different result set by changing the max_parallel_workers_per_gather parameter value and once you change the value of this parameter, please do not forget to restart PostgreSQL Service. (You can find this parameter in postgresql.conf)</p></blockquote>
<blockquote><p>For each execution result, You should compare the value of &#8220;Execution time&#8221;.&#8217;</p></blockquote>
<p><strong>First create one sample table:</strong><br />
<pre class="crayon-plain-tag">CREATE TABLE tbl_ItemTransactions 
 (
     TranID SERIAL
     ,TransactionDate TIMESTAMPTZ
     ,TransactionName TEXT
 );</pre>
<strong>Insert Millions of data to test the performance of BRIN Index:</strong><br />
<pre class="crayon-plain-tag">INSERT INTO tbl_ItemTransactions 
(TransactionDate, TransactionName)
SELECT x, 'dbrnd' 
FROM generate_series('2014-01-01 00:00:00'::timestamptz, '2016-08-01 00:00:00'::timestamptz,'2 seconds'::interval) a(x);</pre>
<strong>Check the total size of table:</strong><br />
<pre class="crayon-plain-tag">SELECT pg_size_pretty(pg_total_relation_size('tbl_ItemTransactions')) AS TableSize;
-- total size "2028 MB"</pre>
<strong>Check the execution plan of below query, where max_parallel_workers_per_gather = 0:</strong><br />
<pre class="crayon-plain-tag">EXPLAIN ANALYZE SELECT COUNT(1) FROM tbl_ItemTransactions;</pre>
<strong>Result:</strong><br />
<pre class="crayon-plain-tag">"Aggregate  (cost=768697.65..768697.66 rows=1 width=8) 
(actual time=59863.028..59863.029 rows=1 loops=1)"
"  -&gt;  Seq Scan on tbl_itemtransactions  
(cost=0.00..666853.32 rows=40737732 width=0) 
(actual time=0.825..30647.470 rows=40737601 loops=1)"
"Planning time: 0.079 ms"
"Execution time: 59863.095 ms"</pre>
<strong>Check the execution plan of below query, where max_parallel_workers_per_gather = 2:</strong><br />
<pre class="crayon-plain-tag">EXPLAIN ANALYZE SELECT COUNT(1) FROM tbl_ItemTransactions;</pre>
<strong>Result:</strong><br />
<pre class="crayon-plain-tag">"Finalize Aggregate  (cost=472651.90..472651.91 rows=1 width=8) 
(actual time=21129.508..21129.511 rows=1 loops=1)"
"  -&gt;  Gather  (cost=472651.69..472651.90 rows=2 width=8) 
(actual time=21129.213..21129.492 rows=3 loops=1)"
"        Workers Planned: 2"
"        Workers Launched: 2"
"        -&gt;  Partial Aggregate  (cost=471651.69..471651.70 rows=1 width=8) 
(actual time=21102.175..21102.176 rows=1 loops=3)"
"              -&gt;  Parallel Seq Scan on tbl_itemtransactions  
(cost=0.00..429216.55 rows=16974055 width=0) 
(actual time=0.048..10929.919 rows=13579200 loops=3)"
"Planning time: 0.052 ms"
"Execution time: 21132.005 ms"</pre>
<strong>Check the execution plan of below query, where max_parallel_workers_per_gather = 4:</strong><br />
<pre class="crayon-plain-tag">EXPLAIN ANALYZE SELECT COUNT(1) FROM tbl_ItemTransactions;</pre>
<strong>Result:</strong><br />
<pre class="crayon-plain-tag">"Finalize Aggregate  (cost=387781.83..387781.84 rows=1 width=8) 
(actual time=16212.360..16212.361 rows=1 loops=1)"
"  -&gt;  Gather  (cost=387781.41..387781.82 rows=4 width=8) 
(actual time=16211.487..16212.347 rows=5 loops=1)"
"        Workers Planned: 4"
"        Workers Launched: 4"
"        -&gt;  Partial Aggregate  (cost=386781.41..386781.42 rows=1 width=8) 
(actual time=16159.409..16159.409 rows=1 loops=5)"
"              -&gt;  Parallel Seq Scan on tbl_itemtransactions  
(cost=0.00..361320.33 rows=10184433 width=0) 
(actual time=0.043..9301.194 rows=8147520 loops=5)"
"Planning time: 0.050 ms"
"Execution time: 13516.982 ms"</pre>
<strong>Check the execution plan of below query, where max_parallel_workers_per_gather = 6:</strong><br />
<pre class="crayon-plain-tag">EXPLAIN ANALYZE SELECT COUNT(1) FROM tbl_ItemTransactions;</pre>
<strong>Result:</strong><br />
<pre class="crayon-plain-tag">"Finalize Aggregate  (cost=345346.90..345346.91 rows=1 width=8) 
(actual time=16514.376..16514.377 rows=1 loops=1)"
"  -&gt;  Gather  (cost=345346.27..345346.88 rows=6 width=8) 
(actual time=16511.341..16514.351 rows=7 loops=1)"
"        Workers Planned: 6"
"        Workers Launched: 6"
"        -&gt;  Partial Aggregate  (cost=344346.27..344346.28 rows=1 width=8) 
(actual time=16358.386..16358.387 rows=1 loops=7)"
"              -&gt;  Parallel Seq Scan on tbl_itemtransactions  
(cost=0.00..327372.22 rows=6789622 width=0) 
(actual time=0.055..9956.567 rows=5819657 loops=7)"
"Planning time: 0.034 ms"
"Execution time: 10288.810 ms"</pre>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
