<?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 - Techyaz.com</title>
	<atom:link href="https://techyaz.com/category/postgresql/feed/" rel="self" type="application/rss+xml" />
	<link></link>
	<description>Tips, Tutorials and How-to Topics</description>
	<lastBuildDate>Mon, 02 Apr 2018 12:06:55 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8</generator>

<image>
	<url>https://techyaz.com/wp-content/uploads/2017/11/cropped-Site-icon-150x150.png</url>
	<title>PostgreSQL - Techyaz.com</title>
	<link></link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>How to Install PgAdmin 4 in Debian 9 Stretch?</title>
		<link>https://techyaz.com/postgresql/install-pgadmin-4-in-debian-9-stretch/</link>
					<comments>https://techyaz.com/postgresql/install-pgadmin-4-in-debian-9-stretch/#comments</comments>
		
		<dc:creator><![CDATA[Angelo Marquez]]></dc:creator>
		<pubDate>Thu, 01 Feb 2018 12:05:40 +0000</pubDate>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux Tools]]></category>
		<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[installation]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[pgadmin]]></category>
		<guid isPermaLink="false">http://techyaz.com/?p=1702</guid>

					<description><![CDATA[<p>I have written how to install PostgreSQL 10.1 on debian 9 stretch in my last article. Read the attached link if you want to learn its step by step process. Here, I am going to install pgAdmin 4 on debian&#46;&#46;&#46;</p>
<p>The post <a href="https://techyaz.com/postgresql/install-pgadmin-4-in-debian-9-stretch/">How to Install PgAdmin 4 in Debian 9 Stretch?</a> appeared first on <a href="https://techyaz.com">Techyaz.com</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>I have written<strong> <a href="http://techyaz.com/debian/install-postgresql-10-1-debian-9-stretch/" target="_blank" rel="noopener">how to install PostgreSQL 10.1 on debian 9 stretch</a> </strong>in my last article. Read the attached link if you want to learn its step by step process. Here, I am going to install pgAdmin 4 on debian 9 stretch that is most popular and feature rich Open Source administration and development tool to manage PostgreSQL databases.</p>
<p><img fetchpriority="high" decoding="async" class="size-full wp-image-1722 alignleft" src="http://techyaz.com/wp-content/uploads/2018/02/pgadmin4-300x200.png" alt="pgadmin4 installation" width="300" height="300" srcset="https://techyaz.com/wp-content/uploads/2018/02/pgadmin4-300x200.png 300w, https://techyaz.com/wp-content/uploads/2018/02/pgadmin4-300x200-150x150.png 150w, https://techyaz.com/wp-content/uploads/2018/02/pgadmin4-300x200-160x160.png 160w, https://techyaz.com/wp-content/uploads/2018/02/pgadmin4-300x200-320x320.png 320w" sizes="(max-width: 300px) 100vw, 300px" /></p>
<p>PostgreSQL is for many the best in its area, and it is not the aim of this article to defend or support that theory, what we can say with all certainty is that it is one of the most robust and secure database handlers that exist. As if this were not enough, it has one of the most popular and complete graphical tools to manage it, such as pgAdmin.</p>
<p>As the project <a href="https://www.pgadmin.org/">website</a> says: “pgAdmin is the most popular and feature rich Open Source administration and development platform for PostgreSQL, the most advanced Open Source database in the world.” And of course we can install it in our preferred GNU/LINUX distribution. In this case we are going to install it in our <a href="https://www.debian.org/">Debian</a> 9 Stretch a large GNU/LINUX distribution widely used in the server and database area.</p>
<h3><span style="color: #333399;">Install pgAdmin 4 on Debian 9 Stretch</span></h3>
<p><strong>Note: In this tutorial it is assumed that you have postgreSQL installed, otherwise, we must install it. You can find the way of doing it in below link.</strong></p>
<ul>
<li><strong><a href="http://techyaz.com/debian/install-postgresql-10-1-debian-9-stretch/" target="_blank" rel="noopener">How to Install PostgreSQL 10.1 on Debian 9 Stretch</a></strong></li>
</ul>
<p>Let&#8217;s get started. The first thing we have to do is add the postgreSQL apt repository. If you have installed postgreSQL with the tutorial we have attached above, you can skip these steps. Otherwise we must add it.</p>
<p>First we logged in as root user. Write su in your terminal screen along with its password and press enter to connect.</p>
<pre><span style="color: #008000;"><strong>#Connect using root user</strong></span>
<span style="color: #0000ff;"><strong>su</strong></span></pre>
<p><img decoding="async" class="wp-image-1706 size-full alignnone" src="http://techyaz.com/wp-content/uploads/2018/02/2-.su-min.png" alt="Connect using superuser" width="505" height="123" srcset="https://techyaz.com/wp-content/uploads/2018/02/2-.su-min.png 505w, https://techyaz.com/wp-content/uploads/2018/02/2-.su-min-300x73.png 300w" sizes="(max-width: 505px) 100vw, 505px" /></p>
<p>Now, use below command to create the <em>pgdp.list</em> file in the <em>/etc/apt/source.list.d/</em> path.</p>
<pre><span style="color: #0000ff;"><strong>nano /etc/apt/source.list.d/pgdg.list</strong></span></pre>
<p>Here, we will add the next line of code to the terminal screen that will come after executing above command.</p>
<pre><strong><span style="color: #0000ff;">deb http://apt.postgresql.org/pub/repos/apt/ stretch-pgdg main</span></strong></pre>
<p><img decoding="async" class="aligncenter wp-image-1707 size-large" src="http://techyaz.com/wp-content/uploads/2018/02/3.-nano-min-1024x552.png" alt="Enter the given code lines" width="1024" height="552" srcset="https://techyaz.com/wp-content/uploads/2018/02/3.-nano-min-1024x552.png 1024w, https://techyaz.com/wp-content/uploads/2018/02/3.-nano-min-300x162.png 300w, https://techyaz.com/wp-content/uploads/2018/02/3.-nano-min-768x414.png 768w, https://techyaz.com/wp-content/uploads/2018/02/3.-nano-min.png 1366w" sizes="(max-width: 1024px) 100vw, 1024px" /></p>
<p>Press <strong>ctrl + x</strong> to exit and select yes to save the changes.</p>
<p>Now import the repository signing key by running below commands on your terminal screen.</p>
<pre><span style="color: #008000;"><strong>#Import the repository signing key</strong></span>
<span style="color: #0000ff;"><strong>wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -</strong></span></pre>
<p>And to refresh the repository cache, just run the following command.</p>
<pre><span style="color: #008000;"><strong>#Refresh the repository.</strong></span>
<span style="color: #0000ff;"><strong>apt update</strong></span></pre>
<p><img loading="lazy" decoding="async" class="alignnone wp-image-1708 size-full" src="http://techyaz.com/wp-content/uploads/2018/02/4.-update-min.png" alt="Run apt update to refresh packages" width="658" height="450" srcset="https://techyaz.com/wp-content/uploads/2018/02/4.-update-min.png 658w, https://techyaz.com/wp-content/uploads/2018/02/4.-update-min-300x205.png 300w" sizes="auto, (max-width: 658px) 100vw, 658px" /></p>
<p>You can see all packages have been updated in above screenshot. Now we are ready to start installing pgAdmin 4.</p>
<h5><span style="color: #333399;"><strong>Installing Dependencies and Creating the Virtual Environment</strong></span></h5>
<p>We must install the necessary dependencies to handle the package. They are basically Python dependencies that needs to be resolved before installing pgadmin package. Execute below command in your terminal before going to install pgadmin.</p>
<pre><span style="color: #008000;"><strong>#Install Python </strong></span><span style="color: #008000;"><b>dependency.</b></span>
<span style="color: #0000ff;"><strong>apt install virtualenv python-pip libpq-dev python-dev</strong></span></pre>
<p><img loading="lazy" decoding="async" class="aligncenter wp-image-1709 size-full" src="http://techyaz.com/wp-content/uploads/2018/02/5.-install_dep-min.png" alt="Install Dependencies" width="752" height="309" srcset="https://techyaz.com/wp-content/uploads/2018/02/5.-install_dep-min.png 752w, https://techyaz.com/wp-content/uploads/2018/02/5.-install_dep-min-300x123.png 300w" sizes="auto, (max-width: 752px) 100vw, 752px" /></p>
<p>Type <strong>Y</strong> and press enter to install this dependency. The next step will be to create the virtual environment. In this case we will create it on <em>/home/Your_user/. </em>Run below commands to get this done.</p>
<pre><span style="color: #0000ff;"><strong><span style="color: #008000;">#Go to your directory.</span>
cd /home/your_user/</strong></span>

<strong><span style="color: #008000;">#Create Virtual Environment.</span></strong>
<span style="color: #0000ff;"><strong>virtualenv pgadmin4</strong></span></pre>
<p><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-1710" src="http://techyaz.com/wp-content/uploads/2018/02/6.-virtualenv-min.png" alt="Run Virtualenv pgadmin4" width="1020" height="192" srcset="https://techyaz.com/wp-content/uploads/2018/02/6.-virtualenv-min.png 1020w, https://techyaz.com/wp-content/uploads/2018/02/6.-virtualenv-min-300x56.png 300w, https://techyaz.com/wp-content/uploads/2018/02/6.-virtualenv-min-768x145.png 768w" sizes="auto, (max-width: 1020px) 100vw, 1020px" /></p>
<p>This creates a folder called &#8220;<em>pgadmin4</em>&#8220;. We must enter it to get in to this folder.</p>
<pre><span style="color: #0000ff;"><strong>cd pgadmin4</strong></span></pre>
<p>The next step will be to &#8220;activate&#8221; the virtual environment by running below statement.</p>
<pre><span style="color: #008000;"><strong>#Activate virtual environment.</strong></span>
<span style="color: #0000ff;"><strong>source bin/activate</strong></span></pre>
<h5><span style="color: #333399;"><strong>Downloading and Installing pgAdmin</strong></span></h5>
<p>Now, we will install pgadmin on this machine. We can download latest version pgAdmin4-2.1 from this <a href="https://www.postgresql.org/ftp/pgadmin/pgadmin4/v2.1/pip/">link</a>. For this tutorial we will use the python package that is showing in below screenshot.</p>
<p><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-1711" src="http://techyaz.com/wp-content/uploads/2018/02/8.-download_pgAdmin-min.png" alt="Download PgAdmin Package" width="864" height="554" srcset="https://techyaz.com/wp-content/uploads/2018/02/8.-download_pgAdmin-min.png 864w, https://techyaz.com/wp-content/uploads/2018/02/8.-download_pgAdmin-min-300x192.png 300w, https://techyaz.com/wp-content/uploads/2018/02/8.-download_pgAdmin-min-768x492.png 768w" sizes="auto, (max-width: 864px) 100vw, 864px" /></p>
<p>And finally we will proceed to install pgadmin using pip command as given below.</p>
<pre><span style="color: #008000;"><strong>#Replace &lt;path-where-file-is-located&gt; with your patch followed by file name.</strong></span>
<span style="color: #0000ff;"><strong>pip install &lt;path-where-file-is-located&gt;</strong></span></pre>
<p>We will be running below command in our case.</p>
<pre><span style="color: #008000;"><strong>#Run below command to install pgadmin.</strong></span>
<strong><span style="color: #0000ff;">pip install /home/angelo/Descargas/pgadmin4-2.1-py2.py3-none-any.whl</span></strong></pre>
<p><img loading="lazy" decoding="async" class="aligncenter wp-image-1712 size-full" src="http://techyaz.com/wp-content/uploads/2018/02/9.-pipinstall-min.png" alt="pip install" width="1282" height="610" srcset="https://techyaz.com/wp-content/uploads/2018/02/9.-pipinstall-min.png 1282w, https://techyaz.com/wp-content/uploads/2018/02/9.-pipinstall-min-300x143.png 300w, https://techyaz.com/wp-content/uploads/2018/02/9.-pipinstall-min-768x365.png 768w, https://techyaz.com/wp-content/uploads/2018/02/9.-pipinstall-min-1024x487.png 1024w" sizes="auto, (max-width: 1282px) 100vw, 1282px" /></p>
<p>With this pgAdmin is already installed but we are not finished yet. You need to create a local configuration and run it. Run below command to do this.</p>
<pre><strong><span style="color: #0000ff;"><span style="color: #008000;">#Go to pgadmin4 folder</span>
cd lib/python2.7/site-packages/pgadmin4

<span style="color: #008000;">#Create config file</span>
touch config_local.py</span></strong></pre>
<p>The &#8220;touch&#8221; command creates an empty file from the linux terminal, if the file exists it will change the date and time of the modification. In that file we can place the settings we want, if the file is left empty it will take the global settings of python.</p>
<p>We can now execute below command to create the credentials. Once you run below command, it will ask you to enter your email address and password. Those credentials will be the ones we use to access the application from the browser.</p>
<pre><strong><span style="color: #0000ff;">python lib/python2.7/site-packages/pgadmin4/pgAdmin4.pyc</span></strong></pre>
<p><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-1713" src="http://techyaz.com/wp-content/uploads/2018/02/10.-python_email-min.png" alt="Python settings" width="1020" height="176" srcset="https://techyaz.com/wp-content/uploads/2018/02/10.-python_email-min.png 1020w, https://techyaz.com/wp-content/uploads/2018/02/10.-python_email-min-300x52.png 300w, https://techyaz.com/wp-content/uploads/2018/02/10.-python_email-min-768x133.png 768w" sizes="auto, (max-width: 1020px) 100vw, 1020px" /></p>
<p>Now we have created the credentials as well in above screenshot. At the end, we will be told that we must log in with our favorite browser to 127.0.0.1:5050 to log in and enter the main page of pgAdmin.</p>
<p><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-1714" src="http://techyaz.com/wp-content/uploads/2018/02/11.-running2-min.png" alt="running pgadmin" width="857" height="176" srcset="https://techyaz.com/wp-content/uploads/2018/02/11.-running2-min.png 857w, https://techyaz.com/wp-content/uploads/2018/02/11.-running2-min-300x62.png 300w, https://techyaz.com/wp-content/uploads/2018/02/11.-running2-min-768x158.png 768w" sizes="auto, (max-width: 857px) 100vw, 857px" /></p>
<p>Let&#8217;s go to our browser and type 127.0.0.1:5050</p>
<p><img loading="lazy" decoding="async" class="aligncenter wp-image-1715 size-full" src="http://techyaz.com/wp-content/uploads/2018/02/12.-login-min.png" alt="Launch pgadmin url" width="942" height="490" srcset="https://techyaz.com/wp-content/uploads/2018/02/12.-login-min.png 942w, https://techyaz.com/wp-content/uploads/2018/02/12.-login-min-300x156.png 300w, https://techyaz.com/wp-content/uploads/2018/02/12.-login-min-768x399.png 768w" sizes="auto, (max-width: 942px) 100vw, 942px" /></p>
<p>We put our email address and the password we have previously entered. We can also select the language. Once we will be logged in using given credentials, we can see the main pgAdmin panel that is also showing in below screenshot.</p>
<p><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-1716" src="http://techyaz.com/wp-content/uploads/2018/02/13.-inside-min.png" alt="PgAdmin Portal" width="1366" height="736" srcset="https://techyaz.com/wp-content/uploads/2018/02/13.-inside-min.png 1366w, https://techyaz.com/wp-content/uploads/2018/02/13.-inside-min-300x162.png 300w, https://techyaz.com/wp-content/uploads/2018/02/13.-inside-min-768x414.png 768w, https://techyaz.com/wp-content/uploads/2018/02/13.-inside-min-1024x552.png 1024w" sizes="auto, (max-width: 1366px) 100vw, 1366px" /></p>
<p>We can test the application by adding a server. In this case it will be a local server. We must click on the &#8220;<em><strong>Add new Server</strong></em>&#8221; link given in between <em>Quick Link</em> section. We will get below screen to enter details about the server that we want to add.</p>
<p><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-1717" src="http://techyaz.com/wp-content/uploads/2018/02/14.-Add_new_server-min.png" alt="Add New Server" width="1366" height="736" srcset="https://techyaz.com/wp-content/uploads/2018/02/14.-Add_new_server-min.png 1366w, https://techyaz.com/wp-content/uploads/2018/02/14.-Add_new_server-min-300x162.png 300w, https://techyaz.com/wp-content/uploads/2018/02/14.-Add_new_server-min-768x414.png 768w, https://techyaz.com/wp-content/uploads/2018/02/14.-Add_new_server-min-1024x552.png 1024w" sizes="auto, (max-width: 1366px) 100vw, 1366px" /></p>
<p>The name we want to give to the connection is placed in the window. I called it &#8220;local.&#8221; We&#8217;ll leave the rest the same, if we want to.</p>
<p>In the connection tab, we will enter the connection parameters <em>Host name, port, database, username, and password </em>to add the server. You can see this in beow screenshot.</p>
<p><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-1718" src="http://techyaz.com/wp-content/uploads/2018/02/15.-Add_server_connection-min.png" alt="Add Server Connection Details" width="1094" height="626" srcset="https://techyaz.com/wp-content/uploads/2018/02/15.-Add_server_connection-min.png 1094w, https://techyaz.com/wp-content/uploads/2018/02/15.-Add_server_connection-min-300x172.png 300w, https://techyaz.com/wp-content/uploads/2018/02/15.-Add_server_connection-min-768x439.png 768w, https://techyaz.com/wp-content/uploads/2018/02/15.-Add_server_connection-min-1024x586.png 1024w" sizes="auto, (max-width: 1094px) 100vw, 1094px" /></p>
<p>And with this we already have an added server and we can start working with postgreSQL. You can see the server is added in left side pane of pgAdmin panel. You can expand the plus sign to see the details like databases etc.</p>
<p><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-1719" src="http://techyaz.com/wp-content/uploads/2018/02/16.-server-min.png" alt="Pgadmin panelpost adding server" width="1366" height="736" srcset="https://techyaz.com/wp-content/uploads/2018/02/16.-server-min.png 1366w, https://techyaz.com/wp-content/uploads/2018/02/16.-server-min-300x162.png 300w, https://techyaz.com/wp-content/uploads/2018/02/16.-server-min-768x414.png 768w, https://techyaz.com/wp-content/uploads/2018/02/16.-server-min-1024x552.png 1024w" sizes="auto, (max-width: 1366px) 100vw, 1366px" /></p>
<h3><span style="color: #333399;"><strong>Conclusion</strong></span></h3>
<p>We have installed pgadmin 4 in debian 9 stretch to manage PostgreSQL databases. Data management is vital to system administration and specialized programs are required to keep data secure and properly structured. Complementing PostgreSQL we have pgAdmin that helps us, with a friendly graphical interface, to manage our databases, to make sentences and to monitor the service.</p>
<p>Installing both is one of the best ways to have and view databases in a way that is appropriate for our applications.</p>
<p>I hope you like this article. Please Like, Share, Comment &amp; Subscribe to this website to get all new articles directly in your inbox. You can also follow our <a href="https://www.facebook.com/Techyaz/">Facebook</a> page and <a href="https://twitter.com/Tech_yaz">Twitter</a> handle to get latest updates.</p>
<p>The post <a href="https://techyaz.com/postgresql/install-pgadmin-4-in-debian-9-stretch/">How to Install PgAdmin 4 in Debian 9 Stretch?</a> appeared first on <a href="https://techyaz.com">Techyaz.com</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://techyaz.com/postgresql/install-pgadmin-4-in-debian-9-stretch/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>How to Install PostgreSQL 10.1 in Debian 9 Stretch</title>
		<link>https://techyaz.com/postgresql/install-postgresql-10-1-debian-9-stretch/</link>
					<comments>https://techyaz.com/postgresql/install-postgresql-10-1-debian-9-stretch/#comments</comments>
		
		<dc:creator><![CDATA[Angelo Marquez]]></dc:creator>
		<pubDate>Tue, 30 Jan 2018 08:02:24 +0000</pubDate>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[installation]]></category>
		<category><![CDATA[Linux]]></category>
		<guid isPermaLink="false">http://techyaz.com/?p=1644</guid>

					<description><![CDATA[<p>I will show you how to install PostgreSQL latest version on debian operating system in this article. PostgreSQL is one of the popular database management system, distinguished by its speed and reliability to maintain the data of our applications. As&#46;&#46;&#46;</p>
<p>The post <a href="https://techyaz.com/postgresql/install-postgresql-10-1-debian-9-stretch/">How to Install PostgreSQL 10.1 in Debian 9 Stretch</a> appeared first on <a href="https://techyaz.com">Techyaz.com</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>I will show you how to install PostgreSQL latest version on debian operating system in this article. PostgreSQL is one of the popular database management system, distinguished by its speed and reliability to maintain the data of our applications. As it says on its website: “<em>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</em>&#8220;. This popular program has reached version 10.1 which brings with it many improvements and above all security improvements. With this new version, PostgreSQL developers want their product to continue gaining ground in the field of database management systems and face other closed source alternatives such as Oracle, DB2 or Microsoft SQL Server.</p>
<p>Installing PostgreSQL in Debian GNU/LINUX is not a major problem, as it is available in the main repositories, but the version that comes with it is not the last one and does not allow us to have the latest updates and security patches that are necessary to ensure data protection.</p>
<p>Read below article if you want to install PostgreSQL administration and development tool pgAdmin on your Debian 9 stretch server.</p>
<ul>
<li><a href="http://techyaz.com/debian/install-pgadmin-4-in-debian-9-stretch/" target="_blank" rel="noopener"><strong>How to Install PgAdmin 4 on Debian 9 Stretch</strong></a></li>
</ul>
<h4><span style="color: #333399;">New Features in </span><span style="color: #333399;">PostgreSQL 10 </span></h4>
<p>PostgreSQL improves with each version, the changes are multiple both in administration and security level. Some important new features of PostgreSQL 10.1 are:</p>
<ul>
<li>Improved authentication process. Thanks to the new authentication system SCRAM-SHA-256.</li>
<li>Many bug fixes for logical replication. Users can now fine-tune replicated data to multiple database clusters and will have the ability to perform zero-time activity updates to larger future versions of PostgreSQL.</li>
<li>Declaratory partitioning of tables. This means that users no longer need to create triggers for routing data; it&#8217;s all handled by the system.</li>
<li>Improved parallel query execution.</li>
<li>Fix memory leak over the lifespan of a query when evaluating a set-returning function from the target list in a SELECT.</li>
</ul>
<p>As has been said, there are many changes at the application level and you can consult them all <a href="https://www.postgresql.org/docs/10/static/release-10-1.html">here.</a></p>
<h4><span style="color: #333399;">Install PostgreSQL 10.1 on Debian</span></h4>
<p>Let&#8217;s get to work  to install PostgreSQL. We will start with Adding PostgreSQL Apt Repository.</p>
<p>The first thing we must do is to create a new file called <em><strong>pgdg.list</strong></em> in the following path: <em><strong>/etc/apt/sources. list.d/</strong></em>. To do this, we must be logged in as superuser. Run below command to connect using superuser.</p>
<pre><span style="color: #008000;"><strong><em>--Connect using superuser</em></strong></span>
<span style="color: #0000ff;"><strong><em>su</em></strong></span></pre>
<p><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-1646" src="http://techyaz.com/wp-content/uploads/2018/01/2-su-min.png" alt="connect using superuser" width="524" height="143" srcset="https://techyaz.com/wp-content/uploads/2018/01/2-su-min.png 524w, https://techyaz.com/wp-content/uploads/2018/01/2-su-min-300x82.png 300w" sizes="auto, (max-width: 524px) 100vw, 524px" /></p>
<p>As you can see in the image, we must enter the password for root access. Then we invoke the nano editor and create the file in question.</p>
<pre><span style="color: #0000ff;"><em><strong>nano /etc/apt/sources.list.d/pgdg.list</strong></em></span></pre>
<p>We further add the below line of code:</p>
<pre><em><strong><span style="color: #0000ff;">deb http://apt.postgresql.org/pub/repos/apt/stretch-pgdg main</span></strong></em></pre>
<p><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-1647" src="http://techyaz.com/wp-content/uploads/2018/01/3-add-pgdgmain-min.png" alt="Add text code to pgdg file" width="658" height="444" srcset="https://techyaz.com/wp-content/uploads/2018/01/3-add-pgdgmain-min.png 658w, https://techyaz.com/wp-content/uploads/2018/01/3-add-pgdgmain-min-300x202.png 300w" sizes="auto, (max-width: 658px) 100vw, 658px" /></p>
<p>Press <strong>Ctrl + x</strong> to save the changes. We say yes and with this we already have the repository added to our software sources.</p>
<p>The next step is import the repository signing key. After updating the package lists, doing this makes our package manager recognize the repository as a reliable one. Execute below commands in your terminal window to import the repository signing key.</p>
<pre><span style="color: #0000ff;"><em><strong><span style="color: #008000;">--import the repository signing key</span>
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -</strong></em></span></pre>
<p><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-1648" src="http://techyaz.com/wp-content/uploads/2018/01/4-Import-Repository-Key-min.png" alt="Import Repository key" width="646" height="151" srcset="https://techyaz.com/wp-content/uploads/2018/01/4-Import-Repository-Key-min.png 646w, https://techyaz.com/wp-content/uploads/2018/01/4-Import-Repository-Key-min-300x70.png 300w" sizes="auto, (max-width: 646px) 100vw, 646px" /></p>
<p>And to refresh the repository cache, just use the following command</p>
<pre><em><strong><span style="color: #0000ff;"><span style="color: #008000;">--Update Package Lists</span>
apt-get update </span></strong></em></pre>
<p><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-1649" src="http://techyaz.com/wp-content/uploads/2018/01/5-apt-get-update-min.png" alt="update package list using apt-get update" width="644" height="338" srcset="https://techyaz.com/wp-content/uploads/2018/01/5-apt-get-update-min.png 644w, https://techyaz.com/wp-content/uploads/2018/01/5-apt-get-update-min-300x157.png 300w" sizes="auto, (max-width: 644px) 100vw, 644px" /></p>
<p>We are now proceeding to install the latest version PostgreSQL 10.1 in our Debian 9 Stretch.  Write in Terminal:</p>
<pre><em><strong><span style="color: #0000ff;"><span style="color: #008000;">--Install PostgreSQL Latest Version.</span>
apt install postgresql-10</span></strong></em></pre>
<p><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-1650" src="http://techyaz.com/wp-content/uploads/2018/01/6-Install-PostgreSQL-min.png" alt="Install PostgreSQL" width="658" height="345" srcset="https://techyaz.com/wp-content/uploads/2018/01/6-Install-PostgreSQL-min.png 658w, https://techyaz.com/wp-content/uploads/2018/01/6-Install-PostgreSQL-min-300x157.png 300w" sizes="auto, (max-width: 658px) 100vw, 658px" /></p>
<p>Above command will download and install the latest version of PostgreSQL on this Debian machine. Type <strong>Y</strong> and press enter to proceed with the installation. After downloading and installing the packages, we must initialize the postgreSQL service because if it is not running, it is not possible to access or connect with it. We can do it with the following command.</p>
<pre><em><strong><span style="color: #008000;">--Start PostgreSQL service.</span></strong></em>
<span style="color: #0000ff;"><em><strong>systemctl start postgresql</strong></em></span></pre>
<p><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-1651" src="http://techyaz.com/wp-content/uploads/2018/01/7-restart-postgreSQL-service-min.png" alt="Restart PostgreSQL Service" width="618" height="136" srcset="https://techyaz.com/wp-content/uploads/2018/01/7-restart-postgreSQL-service-min.png 618w, https://techyaz.com/wp-content/uploads/2018/01/7-restart-postgreSQL-service-min-300x66.png 300w" sizes="auto, (max-width: 618px) 100vw, 618px" /></p>
<p>We verify that we can make connection with PostgreSQL:</p>
<pre><span style="color: #008000;"><em><strong>--Connect to PostgreSQL and Verify Installed PostgreSQL version.</strong></em></span>
<em><strong><span style="color: #0000ff;">su postgres -c psql postgres</span></strong></em></pre>
<p><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-1652" src="http://techyaz.com/wp-content/uploads/2018/01/8-check-postgresql-version-min.png" alt="Connect to PostgreSQL" width="646" height="179" srcset="https://techyaz.com/wp-content/uploads/2018/01/8-check-postgresql-version-min.png 646w, https://techyaz.com/wp-content/uploads/2018/01/8-check-postgresql-version-min-300x83.png 300w" sizes="auto, (max-width: 646px) 100vw, 646px" /></p>
<p>And that&#8217;s it. That&#8217;s all.!!!!!!!!! We already have installed the latest version of this powerful database manager.</p>
<p>Now we can start working, for example, we can show the existing databases in a clean installation of PostgreSQL.</p>
<p><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-1653" src="http://techyaz.com/wp-content/uploads/2018/01/9-connect-postgresql-min.png" alt="Connect to PostgreSQL databases" width="1042" height="402" srcset="https://techyaz.com/wp-content/uploads/2018/01/9-connect-postgresql-min.png 1042w, https://techyaz.com/wp-content/uploads/2018/01/9-connect-postgresql-min-300x116.png 300w, https://techyaz.com/wp-content/uploads/2018/01/9-connect-postgresql-min-768x296.png 768w, https://techyaz.com/wp-content/uploads/2018/01/9-connect-postgresql-min-1024x395.png 1024w" sizes="auto, (max-width: 1042px) 100vw, 1042px" /></p>
<h4><span style="color: #333399;">Conclusion</span></h4>
<p>Debian is a large Linux distribution and is among the most popular in the world of system administrators. Known for its high stability and flexibility, but in its main repositories it has older versions of software and in many cases this is often a big problem. However, there are external repositories that facilitate the distribution of the latest versions of these programs.</p>
<p>PostgreSQL in the world of database has a very high reputation that makes it compete for the throne with other free alternatives such as Mysql or SQLite. Upgrading to the latest stable version guarantees us security patches and new features focused on speed, performance is very useful if we have a large database.</p>
<p>I hope you have learnt how to install PostgreSQL on Debian. Please follow our <a href="https://www.facebook.com/Techyaz/" target="_blank" rel="noopener">Facebook</a> page and <a href="https://twitter.com/Tech_yaz" target="_blank" rel="noopener">Twitter</a> handle to get latest updates.</p>
<p><span style="color: #800000;"><em><strong>Read More:</strong></em></span></p>
<ul>
<li><strong><span style="color: #000080;"><a style="color: #000080;" href="http://techyaz.com/sql-server/sql-server-on-linux/install-sql-server-2017-ubuntu-internet-access/" target="_blank" rel="noopener">How to Install SQL Server 2017 on Ubuntu 16.04?</a></span></strong></li>
<li><strong><span style="color: #000080;"><a style="color: #000080;" href="http://techyaz.com/sql-server/sql-server-on-linux/install-sql-server-on-redhat-linux/" target="_blank" rel="noopener">Installing SQL Server 2017 on Red Hat Linux Server</a></span></strong></li>
<li><strong><span style="color: #000080;"><a style="color: #000080;" href="http://techyaz.com/sql-server/sql-server-on-linux/install-sql-server-2017-on-ubuntu-server-without-internet-offline-installation/" target="_blank" rel="noopener">Installing SQL Server on Ubuntu in Offline Mode</a></span></strong></li>
</ul>
<p>The post <a href="https://techyaz.com/postgresql/install-postgresql-10-1-debian-9-stretch/">How to Install PostgreSQL 10.1 in Debian 9 Stretch</a> appeared first on <a href="https://techyaz.com">Techyaz.com</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://techyaz.com/postgresql/install-postgresql-10-1-debian-9-stretch/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
	</channel>
</rss>
