<?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>PostGIS &#8211; Hostry Help Center</title>
	<atom:link href="https://help.hostry.com/article-tags/postgis/feed/" rel="self" type="application/rss+xml" />
	<link>https://help.hostry.com</link>
	<description>Full information on how to use HOSTRY, provided by 24/7 community based support</description>
	<lastBuildDate>Thu, 13 Aug 2020 08:23:35 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.9.13</generator>

<image>
	<url>https://help.hostry.com/wp-content/uploads/cache/2021/01/cropped-apple-icon-180x180-1/836712163.png</url>
	<title>PostGIS &#8211; Hostry Help Center</title>
	<link>https://help.hostry.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>How to Install PostGIS Extension for PostgreSQL on Ubuntu</title>
		<link>https://help.hostry.com/knowledge-base/how-to-install-postgis-extension-for-postgresql-on-ubuntu/</link>
					<comments>https://help.hostry.com/knowledge-base/how-to-install-postgis-extension-for-postgresql-on-ubuntu/#respond</comments>
		
		<dc:creator><![CDATA[Alex]]></dc:creator>
		<pubDate>Thu, 13 Aug 2020 08:11:49 +0000</pubDate>
				<guid isPermaLink="false">https://help.hostry.com/?post_type=ht_kb&#038;p=1917</guid>

					<description><![CDATA[PostgreSQ is a free open source database with extensions available to extend its capabilities. PostGIS is a spatial database extension that provides PostgreSQL with location and geography capabilities. PostGIS adds a POINT datatype for location and can return location radii and can return location radiuses and distances using relevant queries [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p><strong><a href="https://www.postgresql.org/">PostgreSQ </a></strong>is a free open source database with extensions available to extend its capabilities. PostGIS is a spatial database extension that provides PostgreSQL with location and geography capabilities. PostGIS adds a POINT datatype for location and can return location radii  and can return location radiuses and distances using relevant queries </p>



<h2 id="configure-a-repository" >Configure a repository</h2>



<p>Install the required Gnu Privacy Guard dependency</p>



<p><code>$ sudo apt -y install gnupg2 </code></p>



<p>Import the PGP signing key for the given repository</p>



<p><code>$ wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - </code></p>



<p>Add PostgreSQL apt repository</p>



<p><code>$ echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" | sudo tee /etc/apt/sources.list.d/pgdg.list </code></p>



<h2 id="install-postgresql-and-postgis" >Install PostgreSQL and PostGIS</h2>



<p>In this step, you must first install PostgreSQL</p>



<p><code>$ sudo apt -y install postgresql-12 postgresql-client-12 </code></p>



<p>Then install PostGIS</p>



<p><code>$ sudo apt install postgis postgresql-12-postgis-3 </code></p>



<p>After that, install all the necessary control packages</p>



<pre class="wp-block-code"><code>$ sudo apt-get install postgresql-12-postgis-3-scripts</code></pre>



<h2 id="log-into-postgresql-and-enable-postgis" >Log into PostgreSQL and enable PostGIS</h2>



<p>First, log in as superuser</p>



<p><code>$ sudo su - postgres </code></p>



<p>Next, create a new PostgreSQL user</p>



<p><code>$ createuser exampleuser </code></p>



<p>After that, set a password for the new user</p>



<p><code>$ psql -c "alter user exampleuser with password 'yourPassword'" </code></p>



<p>Create a new database</p>



<p><code>$ createdb my_db -O exampleuser </code></p>



<p>Connect to database</p>



<pre class="wp-block-code"><code>$ psql -d my_db</code></pre>



<p>Enable PostGIS Database Extension</p>



<pre class="wp-block-code"><code>my_db=# CREATE EXTENSION postgis;</code></pre>



<p>Test the PostGIS extension</p>



<pre class="wp-block-code"><code>my_db=# SELECT PostGIS_version();</code></pre>



<p></p>
]]></content:encoded>
					
					<wfw:commentRss>https://help.hostry.com/knowledge-base/how-to-install-postgis-extension-for-postgresql-on-ubuntu/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
