485 lines
31 KiB
HTML
485 lines
31 KiB
HTML
|
||
|
||
<!DOCTYPE html>
|
||
<html lang="en" >
|
||
|
||
<!-- Mirrored from geohelm.docs.acugis.com/en/latest/components/createdb/index.html by HTTrack Website Copier/3.x [XR&CO'2014], Thu, 13 Jul 2023 23:21:59 GMT -->
|
||
<!-- Added by HTTrack --><meta http-equiv="content-type" content="text/html;charset=utf-8" /><!-- /Added by HTTrack -->
|
||
<head>
|
||
<meta charset="utf-8">
|
||
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||
|
||
<title>Create Database — AcuGIS GeoHelm 0.4.3 documentation</title>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<!-- AcuGIS 1 -->
|
||
|
||
|
||
|
||
|
||
<!--[if lt IE 9]>
|
||
<script src="../../_static/js/html5shiv.min.js"></script>
|
||
<![endif]-->
|
||
|
||
|
||
<script type="text/javascript" id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></script>
|
||
<script type="text/javascript" src="../../_static/jquery.js"></script>
|
||
<script type="text/javascript" src="../../_static/underscore.js"></script>
|
||
<script type="text/javascript" src="../../_static/doctools.js"></script>
|
||
<script type="text/javascript" src="../../_static/language_data.js"></script>
|
||
<script async="async" type="text/javascript" src="../../../../_/static/javascript/readthedocs-doc-embed.js"></script>
|
||
|
||
<script type="text/javascript" src="../../_static/js/theme.js"></script>
|
||
|
||
|
||
|
||
|
||
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
|
||
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
|
||
<link rel="stylesheet" href="../../_static/custom.css" type="text/css" />
|
||
<link rel="index" title="Index" href="../../genindex.html" />
|
||
<link rel="search" title="Search" href="../../search.html" />
|
||
<link rel="next" title="PostgreSQL" href="../postgresql/index.html" />
|
||
<link rel="prev" title="Control Panel" href="../../webmin.html" />
|
||
|
||
<!-- RTD Extra Head -->
|
||
|
||
<link rel="stylesheet" href="../../../../_/static/css/readthedocs-doc-embed.css" type="text/css" />
|
||
|
||
<script type="application/json" id="READTHEDOCS_DATA">{"ad_free": false, "api_host": "https://readthedocs.org", "builder": "sphinx", "canonical_url": null, "docroot": "/docs/", "features": {"docsearch_disabled": false}, "global_analytics_code": "UA-17997319-1", "language": "en", "page": "components/createdb/index", "programming_language": "perl", "project": "geohelm", "proxied_api_host": "/_", "source_suffix": ".rst", "subprojects": {}, "theme": "sphinx_rtd_theme", "user_analytics_code": "", "version": "latest"}</script>
|
||
|
||
<!--
|
||
Using this variable directly instead of using `JSON.parse` is deprecated.
|
||
The READTHEDOCS_DATA global variable will be removed in the future.
|
||
-->
|
||
<script type="text/javascript">
|
||
READTHEDOCS_DATA = JSON.parse(document.getElementById('READTHEDOCS_DATA').innerHTML);
|
||
</script>
|
||
|
||
<script type="text/javascript" src="../../../../_/static/javascript/readthedocs-analytics.js" async="async"></script>
|
||
|
||
<!-- end RTD <extrahead> -->
|
||
</head>
|
||
|
||
|
||
<div id="header" style="position: fixed; height: 70px; padding-bottom: 20px; overflow: hidden; background-color: #28728d; display: block; z-index: 1000; width: 100%;">
|
||
<div class="acugis_geosuite" style="color:#fff!important; padding-left:30px; font-size:26px; padding-top: 20px;"><a href="https://geohelm.docs.acugis.com/" style="color:#fff!important; text-decoration:none!important">AcuGIS GeoHelm</a></div>
|
||
|
||
</div>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
</div>
|
||
<body class="wy-body-for-nav">
|
||
|
||
|
||
<div class="wy-grid-for-nav">
|
||
|
||
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
|
||
<div class="wy-side-scroll">
|
||
|
||
<div id="header2"> </div>
|
||
|
||
|
||
|
||
|
||
|
||
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation" style="padding-top: 45px;">
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<p class="caption"><span class="caption-text">Getting Started</span></p>
|
||
<ul>
|
||
<li class="toctree-l1"><a class="reference internal" href="../../intro.html">Intro</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="../../installing.html">Installation</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="../../layout.html">Layout</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="../../webmin.html">Control Panel</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="../../webmin.html#removing-the-control-panel">Removing the Control Panel</a></li>
|
||
</ul>
|
||
<p class="caption"><span class="caption-text">PostGIS</span></p>
|
||
<ul class="current">
|
||
<li class="toctree-l1 current"><a class="current reference internal" href="#">Create Database</a><ul>
|
||
<li class="toctree-l2"><a class="reference internal" href="#the-geodb-database">The geodb Database</a></li>
|
||
<li class="toctree-l2"><a class="reference internal" href="#create-a-user">Create a User</a></li>
|
||
<li class="toctree-l2"><a class="reference internal" href="#create-a-database">Create a Database</a></li>
|
||
<li class="toctree-l2"><a class="reference internal" href="#list-databases">List Databases</a></li>
|
||
<li class="toctree-l2"><a class="reference internal" href="#connect-to-database">Connect to Database</a></li>
|
||
<li class="toctree-l2"><a class="reference internal" href="#list-tables">List Tables</a></li>
|
||
<li class="toctree-l2"><a class="reference internal" href="#create-using-the-control-panel">Create Using the Control Panel</a></li>
|
||
</ul>
|
||
</li>
|
||
<li class="toctree-l1"><a class="reference internal" href="../postgresql/index.html">PostgreSQL</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="../postgis/index.html">PostGIS</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="../pgrouting/index.html">PgRouting</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="../shp2pgsql/index.html">shp2pgsql</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="../osm2pgsql/index.html">osm2pgsql</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="../raster2pgsql/index.html">raster2pgsql</a></li>
|
||
</ul>
|
||
<p class="caption"><span class="caption-text">GeoServer</span></p>
|
||
<ul>
|
||
<li class="toctree-l1"><a class="reference internal" href="../../geoserver/admin/index.html">Access</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="../../geoserver/geoservers/index.html">Overview</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="../../geoserver/tomcat/index.html">Apache Tomcat</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="../../geoserver/workspace/index.html">Create a Workspace</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="../../geoserver/store/index.html">Create Store</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="../../geoserver/layer/index.html">Add Layer</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="../../geoserver/shp/index.html">Load ESRI Shapefile</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="../../geoserver/styles/index.html">Styles</a></li>
|
||
</ul>
|
||
<p class="caption"><span class="caption-text">pg_tileserv</span></p>
|
||
<ul>
|
||
<li class="toctree-l1"><a class="reference internal" href="../pgtileserv/index.html">pg_tileserv</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="../pgfeatureserv/index.html">pg_featureserv</a></li>
|
||
</ul>
|
||
<p class="caption"><span class="caption-text">Database Operations</span></p>
|
||
<ul>
|
||
<li class="toctree-l1"><a class="reference internal" href="../../database/snapshot/index.html">Database Snapshots</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="../../database/clone/index.html">Clone Database</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="../../database/restore/index.html">Restore Database</a></li>
|
||
</ul>
|
||
<p class="caption"><span class="caption-text">QGIS</span></p>
|
||
<ul>
|
||
<li class="toctree-l1"><a class="reference internal" href="../../qgis/home.html">Introduction</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="../../qgis/pgservice.html">pg_service.conf</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="../../qgis/qgis.html">Create a QGIS Project</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="../../qgis/publish.html">Publish Layers</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="../../qgis/style-only.html">Publish Styles Only</a></li>
|
||
</ul>
|
||
<p class="caption"><span class="caption-text">LeafletJS</span></p>
|
||
<ul>
|
||
<li class="toctree-l1"><a class="reference internal" href="../../apps/choropleth.html">Leaflet Choropleth App</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="../../apps/geojson.html">Leaflet GeoJson</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="../../apps/php.html">Leaflet and PHP</a></li>
|
||
</ul>
|
||
<p class="caption"><span class="caption-text">Resources</span></p>
|
||
<ul>
|
||
<li class="toctree-l1"><a class="reference internal" href="../../resources/documents.html">Documentation</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="../../resources/css.html">CSS</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="../../resources/security.html">Security</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="../../resources/nagios.html">Nagios</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="../../resources/support.html">Project Support</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="../../resources/commercial.html">Commercial Support</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="../../resources/license.html">License</a></li>
|
||
</ul>
|
||
|
||
|
||
|
||
</div>
|
||
|
||
</div>
|
||
</nav>
|
||
|
||
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
|
||
|
||
|
||
<nav class="wy-nav-top" aria-label="top navigation">
|
||
|
||
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
|
||
<a href="../../index-2.html">AcuGIS GeoHelm</a>
|
||
|
||
</nav>
|
||
|
||
|
||
<div class="wy-nav-content">
|
||
|
||
<div class="rst-content">
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<div role="navigation" aria-label="breadcrumbs navigation">
|
||
|
||
<ul class="wy-breadcrumbs">
|
||
|
||
<li><a href="../../index-2.html" class="icon icon-home"></a> »</li>
|
||
|
||
<li>Create Database</li>
|
||
|
||
|
||
<li class="wy-breadcrumbs-aside">
|
||
|
||
|
||
|
||
<a href="https://github.com/AcuGIS/GeoHelm/blob/master/docs/components/createdb/index.rst" class="fa fa-github"> Edit on GitHub</a>
|
||
|
||
|
||
|
||
</li>
|
||
|
||
</ul>
|
||
|
||
|
||
<hr/>
|
||
</div>
|
||
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
|
||
<div itemprop="articleBody">
|
||
|
||
<div class="section" id="create-database">
|
||
<h1><a class="toc-backref" href="#id1">Create Database</a><a class="headerlink" href="#create-database" title="Permalink to this headline">¶</a></h1>
|
||
<div class="contents topic" id="table-of-contents">
|
||
<p class="topic-title">Table of Contents</p>
|
||
<ul class="simple">
|
||
<li><a class="reference internal" href="#create-database" id="id1">Create Database</a><ul>
|
||
<li><a class="reference internal" href="#the-geodb-database" id="id2">The geodb Database</a></li>
|
||
<li><a class="reference internal" href="#create-a-user" id="id3">Create a User</a></li>
|
||
<li><a class="reference internal" href="#create-a-database" id="id4">Create a Database</a></li>
|
||
<li><a class="reference internal" href="#list-databases" id="id5">List Databases</a></li>
|
||
<li><a class="reference internal" href="#connect-to-database" id="id6">Connect to Database</a></li>
|
||
<li><a class="reference internal" href="#list-tables" id="id7">List Tables</a></li>
|
||
<li><a class="reference internal" href="#create-using-the-control-panel" id="id8">Create Using the Control Panel</a></li>
|
||
</ul>
|
||
</li>
|
||
</ul>
|
||
</div>
|
||
<div class="section" id="the-geodb-database">
|
||
<h2><a class="toc-backref" href="#id2">The geodb Database</a><a class="headerlink" href="#the-geodb-database" title="Permalink to this headline">¶</a></h2>
|
||
<p>We will be using the geodb database throughout these docs and tutorials.</p>
|
||
<p>We’ll see how to create the database and user using psql as well as the control panel and PgAdmin.</p>
|
||
<p>You can use any PostGIS enabled database, or give your database any other name you wish to.</p>
|
||
</div>
|
||
<div class="section" id="create-a-user">
|
||
<h2><a class="toc-backref" href="#id3">Create a User</a><a class="headerlink" href="#create-a-user" title="Permalink to this headline">¶</a></h2>
|
||
<p>To create a PostgreSQL user, connect to psql</p>
|
||
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>root@demo:~#<span class="w"> </span>su<span class="w"> </span>-<span class="w"> </span>postgres
|
||
postgres@lizmap-demo:~$<span class="w"> </span>psql
|
||
psql<span class="w"> </span><span class="o">(</span><span class="m">15</span>.3<span class="w"> </span><span class="o">(</span>Ubuntu<span class="w"> </span><span class="m">15</span>.3-1.pgdg22.04+1<span class="o">))</span>
|
||
Type<span class="w"> </span><span class="s2">"help"</span><span class="w"> </span><span class="k">for</span><span class="w"> </span>help.
|
||
<span class="nv">postgres</span><span class="o">=</span><span class="c1">#</span>
|
||
</pre></div>
|
||
</div>
|
||
<p>Issue the CREATE USER command and supply a password:</p>
|
||
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span><span class="nv">postgres</span><span class="o">=</span><span class="c1"># CREATE USER geouser WITH PASSWORD 'SecretPassword';</span>
|
||
</pre></div>
|
||
</div>
|
||
<p>Replace SecretPassword above with a secure password.</p>
|
||
</div>
|
||
<div class="section" id="create-a-database">
|
||
<h2><a class="toc-backref" href="#id4">Create a Database</a><a class="headerlink" href="#create-a-database" title="Permalink to this headline">¶</a></h2>
|
||
<p>To create our PostgreSQL database, geodb, connect to psql</p>
|
||
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>postgres@demo:~$<span class="w"> </span>psql
|
||
<span class="nv">postgres</span><span class="o">=</span><span class="c1">#</span>
|
||
</pre></div>
|
||
</div>
|
||
<p>We’ll now create the database with the CREATE DATABASE command and give ownership to user we created above:</p>
|
||
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span><span class="nv">postgres</span><span class="o">=</span><span class="c1"># CREATE DATABASE geodb WITH OWNER = geouser;</span>
|
||
</pre></div>
|
||
</div>
|
||
<p>The above will create our database as well as give ownership of the database to user geouser</p>
|
||
</div>
|
||
<div class="section" id="list-databases">
|
||
<h2><a class="toc-backref" href="#id5">List Databases</a><a class="headerlink" href="#list-databases" title="Permalink to this headline">¶</a></h2>
|
||
<p>We can list all databases by connecting as postgres and issuing \l</p>
|
||
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>postgres@demo:~$<span class="w"> </span>psql
|
||
psql<span class="w"> </span><span class="o">(</span><span class="m">15</span>.3<span class="w"> </span><span class="o">(</span>Ubuntu<span class="w"> </span><span class="m">15</span>.3-1.pgdg22.04+1<span class="o">))</span>
|
||
Type<span class="w"> </span><span class="s2">"help"</span><span class="w"> </span><span class="k">for</span><span class="w"> </span>help.
|
||
<span class="nv">postgres</span><span class="o">=</span><span class="c1"># \l</span>
|
||
<span class="w"> </span>List<span class="w"> </span>of<span class="w"> </span>databases
|
||
Name<span class="w"> </span><span class="p">|</span><span class="w"> </span>Owner<span class="w"> </span><span class="p">|</span><span class="w"> </span>Encoding<span class="w"> </span><span class="p">|</span><span class="w"> </span>Collate<span class="w"> </span><span class="p">|</span><span class="w"> </span>Ctype<span class="w"> </span><span class="p">|</span><span class="w"> </span>ICU<span class="w"> </span>Locale<span class="w"> </span><span class="p">|</span><span class="w"> </span>Locale<span class="w"> </span>Provider<span class="w"> </span><span class="p">|</span><span class="w"> </span>Access<span class="w"> </span>privileges
|
||
------------+----------+----------+---------+---------+------------+-----------------+-----------------------
|
||
geostore<span class="w"> </span><span class="p">|</span><span class="w"> </span>postgres<span class="w"> </span><span class="p">|</span><span class="w"> </span>UTF8<span class="w"> </span><span class="p">|</span><span class="w"> </span>C.UTF-8<span class="w"> </span><span class="p">|</span><span class="w"> </span>C.UTF-8<span class="w"> </span><span class="p">|</span><span class="w"> </span><span class="p">|</span><span class="w"> </span>libc<span class="w"> </span><span class="p">|</span>
|
||
geodb<span class="w"> </span><span class="p">|</span><span class="w"> </span>geouser<span class="w"> </span><span class="p">|</span><span class="w"> </span>UTF8<span class="w"> </span><span class="p">|</span><span class="w"> </span>C.UTF-8<span class="w"> </span><span class="p">|</span><span class="w"> </span>C.UTF-8<span class="w"> </span><span class="p">|</span><span class="w"> </span><span class="p">|</span><span class="w"> </span>libc<span class="w"> </span><span class="p">|</span>
|
||
postgisftw<span class="w"> </span><span class="p">|</span><span class="w"> </span>pgis<span class="w"> </span><span class="p">|</span><span class="w"> </span>UTF8<span class="w"> </span><span class="p">|</span><span class="w"> </span>C.UTF-8<span class="w"> </span><span class="p">|</span><span class="w"> </span>C.UTF-8<span class="w"> </span><span class="p">|</span><span class="w"> </span><span class="p">|</span><span class="w"> </span>libc<span class="w"> </span><span class="p">|</span>
|
||
postgres<span class="w"> </span><span class="p">|</span><span class="w"> </span>postgres<span class="w"> </span><span class="p">|</span><span class="w"> </span>UTF8<span class="w"> </span><span class="p">|</span><span class="w"> </span>C.UTF-8<span class="w"> </span><span class="p">|</span><span class="w"> </span>C.UTF-8<span class="w"> </span><span class="p">|</span><span class="w"> </span><span class="p">|</span><span class="w"> </span>libc<span class="w"> </span><span class="p">|</span>
|
||
template0<span class="w"> </span><span class="p">|</span><span class="w"> </span>postgres<span class="w"> </span><span class="p">|</span><span class="w"> </span>UTF8<span class="w"> </span><span class="p">|</span><span class="w"> </span>C.UTF-8<span class="w"> </span><span class="p">|</span><span class="w"> </span>C.UTF-8<span class="w"> </span><span class="p">|</span><span class="w"> </span><span class="p">|</span><span class="w"> </span>libc<span class="w"> </span><span class="p">|</span><span class="w"> </span><span class="o">=</span>c/postgres<span class="w"> </span>+
|
||
<span class="w"> </span><span class="p">|</span><span class="w"> </span><span class="p">|</span><span class="w"> </span><span class="p">|</span><span class="w"> </span><span class="p">|</span><span class="w"> </span><span class="p">|</span><span class="w"> </span><span class="p">|</span><span class="w"> </span><span class="p">|</span><span class="w"> </span><span class="nv">postgres</span><span class="o">=</span>CTc/postgres
|
||
template1<span class="w"> </span><span class="p">|</span><span class="w"> </span>postgres<span class="w"> </span><span class="p">|</span><span class="w"> </span>UTF8<span class="w"> </span><span class="p">|</span><span class="w"> </span>C.UTF-8<span class="w"> </span><span class="p">|</span><span class="w"> </span>C.UTF-8<span class="w"> </span><span class="p">|</span><span class="w"> </span><span class="p">|</span><span class="w"> </span>libc<span class="w"> </span><span class="p">|</span><span class="w"> </span><span class="o">=</span>c/postgres<span class="w"> </span>+
|
||
<span class="w"> </span><span class="p">|</span><span class="w"> </span><span class="p">|</span><span class="w"> </span><span class="p">|</span><span class="w"> </span><span class="p">|</span><span class="w"> </span><span class="p">|</span><span class="w"> </span><span class="p">|</span><span class="w"> </span><span class="p">|</span><span class="w"> </span><span class="nv">postgres</span><span class="o">=</span>CTc/postgres
|
||
<span class="o">(</span><span class="m">5</span><span class="w"> </span>rows<span class="o">)</span>
|
||
|
||
<span class="o">(</span>END<span class="o">)</span>
|
||
</pre></div>
|
||
</div>
|
||
</div>
|
||
<div class="section" id="connect-to-database">
|
||
<h2><a class="toc-backref" href="#id6">Connect to Database</a><a class="headerlink" href="#connect-to-database" title="Permalink to this headline">¶</a></h2>
|
||
<p>To connect to our PostgreSQL database, geodb, connect to psql</p>
|
||
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>postgres@demo:~$<span class="w"> </span>psql
|
||
<span class="nv">postgres</span><span class="o">=</span><span class="c1">#</span>
|
||
</pre></div>
|
||
</div>
|
||
<p>Use \c to connect to the database</p>
|
||
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span><span class="nv">postgres</span><span class="o">=</span><span class="c1"># \c geodb</span>
|
||
You<span class="w"> </span>are<span class="w"> </span>now<span class="w"> </span>connected<span class="w"> </span>to<span class="w"> </span>database<span class="w"> </span><span class="s2">"geodb"</span><span class="w"> </span>as<span class="w"> </span>user<span class="w"> </span><span class="s2">"postgres"</span>.
|
||
</pre></div>
|
||
</div>
|
||
</div>
|
||
<div class="section" id="list-tables">
|
||
<h2><a class="toc-backref" href="#id7">List Tables</a><a class="headerlink" href="#list-tables" title="Permalink to this headline">¶</a></h2>
|
||
<p>To list all relations in a database, connect to the database and use \dt</p>
|
||
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span><span class="nv">postgres</span><span class="o">=</span><span class="c1"># \c geodb</span>
|
||
<span class="nv">postgres</span><span class="o">=</span><span class="c1"># \dt</span>
|
||
Did<span class="w"> </span>not<span class="w"> </span>find<span class="w"> </span>any<span class="w"> </span>relations.
|
||
</pre></div>
|
||
</div>
|
||
<p>Since we just created our database and have not created any tables, no relations are found.</p>
|
||
<p>Let’s connect to the postgisftw database created when we installed pg_tileserv.</p>
|
||
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span><span class="nv">postgres</span><span class="o">=</span><span class="c1"># \c postgisftw</span>
|
||
You<span class="w"> </span>are<span class="w"> </span>now<span class="w"> </span>connected<span class="w"> </span>to<span class="w"> </span>database<span class="w"> </span><span class="s2">"postgisftw"</span><span class="w"> </span>as<span class="w"> </span>user<span class="w"> </span><span class="s2">"postgres"</span>.
|
||
</pre></div>
|
||
</div>
|
||
<p>Now, list the relations using \dt</p>
|
||
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span><span class="nv">postgisftw</span><span class="o">=</span><span class="c1"># \dt</span>
|
||
<span class="w"> </span>List<span class="w"> </span>of<span class="w"> </span>relations
|
||
Schema<span class="w"> </span><span class="p">|</span><span class="w"> </span>Name<span class="w"> </span><span class="p">|</span><span class="w"> </span>Type<span class="w"> </span><span class="p">|</span><span class="w"> </span>Owner
|
||
--------+-------------------+-------+----------
|
||
public<span class="w"> </span><span class="p">|</span><span class="w"> </span>configuration<span class="w"> </span><span class="p">|</span><span class="w"> </span>table<span class="w"> </span><span class="p">|</span><span class="w"> </span>pgis
|
||
public<span class="w"> </span><span class="p">|</span><span class="w"> </span>countries<span class="w"> </span><span class="p">|</span><span class="w"> </span>table<span class="w"> </span><span class="p">|</span><span class="w"> </span>pgis
|
||
public<span class="w"> </span><span class="p">|</span><span class="w"> </span>pointsofinterest<span class="w"> </span><span class="p">|</span><span class="w"> </span>table<span class="w"> </span><span class="p">|</span><span class="w"> </span>pgis
|
||
public<span class="w"> </span><span class="p">|</span><span class="w"> </span>spatial_ref_sys<span class="w"> </span><span class="p">|</span><span class="w"> </span>table<span class="w"> </span><span class="p">|</span><span class="w"> </span>postgres
|
||
public<span class="w"> </span><span class="p">|</span><span class="w"> </span>ways<span class="w"> </span><span class="p">|</span><span class="w"> </span>table<span class="w"> </span><span class="p">|</span><span class="w"> </span>pgis
|
||
public<span class="w"> </span><span class="p">|</span><span class="w"> </span>ways_vertices_pgr<span class="w"> </span><span class="p">|</span><span class="w"> </span>table<span class="w"> </span><span class="p">|</span><span class="w"> </span>pgis
|
||
<span class="o">(</span><span class="m">8</span><span class="w"> </span>rows<span class="o">)</span>
|
||
|
||
<span class="nv">postgisftw</span><span class="o">=</span><span class="c1">#</span>
|
||
</pre></div>
|
||
</div>
|
||
<p>We’ve now seen how to create a PostgreSQL database and user, as well as how to connect to our database and list relations</p>
|
||
</div>
|
||
<div class="section" id="create-using-the-control-panel">
|
||
<h2><a class="toc-backref" href="#id8">Create Using the Control Panel</a><a class="headerlink" href="#create-using-the-control-panel" title="Permalink to this headline">¶</a></h2>
|
||
<p>We’ll now see how to create our user and database via the control panel.</p>
|
||
<p>Begin by clicking “PostgreSQL Database Server” on the left menu</p>
|
||
<p><strong>1. Click the “PostgreSQL Users” icon as show below</strong></p>
|
||
<a class="reference internal image-reference" href="../../_images/1-Create-DB-user.png"><img alt="../../_images/1-Create-DB-user.png" src="../../_images/1-Create-DB-user.png" style="width: 100%;" /></a>
|
||
<img alt="../../_images/spacer1.png" src="../../_images/spacer1.png" />
|
||
<p><strong>2. Click the “Create New User” button as show below</strong></p>
|
||
<a class="reference internal image-reference" href="../../_images/2-Create-DB-user-2.png"><img alt="../../_images/2-Create-DB-user-2.png" src="../../_images/2-Create-DB-user-2.png" style="width: 100%;" /></a>
|
||
<img alt="../../_images/spacer1.png" src="../../_images/spacer1.png" />
|
||
<p><strong>3. For the usrname, enter geouser, for the password enter a secure password.</strong></p>
|
||
<p><strong>4. Click the “Create” button</strong></p>
|
||
<a class="reference internal image-reference" href="../../_images/3-Create-DB-user-3.png"><img alt="../../_images/3-Create-DB-user-3.png" src="../../_images/3-Create-DB-user-3.png" style="width: 100%;" /></a>
|
||
<img alt="../../_images/spacer1.png" src="../../_images/spacer1.png" />
|
||
<p><strong>5. Back on the main PostgreSQL Database menu, click the “Create a New Database” button</strong></p>
|
||
<a class="reference internal image-reference" href="../../_images/4-Create-DB-panel-1.png"><img alt="../../_images/4-Create-DB-panel-1.png" src="../../_images/4-Create-DB-panel-1.png" style="width: 100%;" /></a>
|
||
<img alt="../../_images/spacer1.png" src="../../_images/spacer1.png" />
|
||
<p><strong>6. For the database name, enter geodb and select the user we created (geouser) from the dropdown for Database Owner.</strong></p>
|
||
<p><strong>7. Click the Create button</strong></p>
|
||
<a class="reference internal image-reference" href="../../_images/5-Create-DB-panel-2.png"><img alt="../../_images/5-Create-DB-panel-2.png" src="../../_images/5-Create-DB-panel-2.png" style="width: 100%;" /></a>
|
||
<img alt="../../_images/spacer1.png" src="../../_images/spacer1.png" />
|
||
<p><strong>The database should now appear in the main PostgreSQL section.</strong></p>
|
||
<a class="reference internal image-reference" href="../../_images/6-view-database.png"><img alt="../../_images/6-view-database.png" src="../../_images/6-view-database.png" style="width: 100%;" /></a>
|
||
<img alt="../../_images/spacer1.png" src="../../_images/spacer1.png" />
|
||
<p>We’ve now used the control panel to create a PostgreSQL user and database.</p>
|
||
</div>
|
||
</div>
|
||
|
||
|
||
</div>
|
||
|
||
</div>
|
||
<footer>
|
||
|
||
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
|
||
|
||
<a href="../postgresql/index.html" class="btn btn-neutral float-right" title="PostgreSQL" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
|
||
|
||
|
||
<a href="../../webmin.html" class="btn btn-neutral float-left" title="Control Panel" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
|
||
|
||
</div>
|
||
|
||
|
||
<hr/>
|
||
|
||
<div role="contentinfo">
|
||
<p>
|
||
|
||
© Copyright acugis
|
||
<span class="commit">
|
||
Revision <code>db2a027e</code>.
|
||
</span>
|
||
|
||
</p>
|
||
</div>
|
||
|
||
|
||
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org/">Read the Docs</a>.
|
||
|
||
</footer>
|
||
|
||
</div>
|
||
</div>
|
||
|
||
</section>
|
||
|
||
</div>
|
||
|
||
|
||
<div class="rst-versions" data-toggle="rst-versions" role="note" aria-label="versions">
|
||
<span class="rst-current-version" data-toggle="rst-current-version">
|
||
<span class="fa fa-book"> Read the Docs</span>
|
||
v: latest
|
||
<span class="fa fa-caret-down"></span>
|
||
</span>
|
||
<div class="rst-other-versions">
|
||
<dl>
|
||
<dt>Versions</dt>
|
||
|
||
<dd><a href="../../index.html">latest</a></dd>
|
||
|
||
</dl>
|
||
<dl>
|
||
<dt>Downloads</dt>
|
||
|
||
<dd><a href="http://geohelm.docs.acugis.com/_/downloads/en/latest/pdf/">pdf</a></dd>
|
||
|
||
<dd><a href="http://geohelm.docs.acugis.com/_/downloads/en/latest/htmlzip/">html</a></dd>
|
||
|
||
<dd><a href="http://geohelm.docs.acugis.com/_/downloads/en/latest/epub/">epub</a></dd>
|
||
|
||
</dl>
|
||
<dl>
|
||
|
||
<dt>On Read the Docs</dt>
|
||
<dd>
|
||
<a href="http://readthedocs.org/projects/geohelm/?fromdocs=geohelm">Project Home</a>
|
||
</dd>
|
||
<dd>
|
||
<a href="http://readthedocs.org/builds/geohelm/?fromdocs=geohelm">Builds</a>
|
||
</dd>
|
||
</dl>
|
||
</div>
|
||
</div>
|
||
|
||
|
||
<script type="text/javascript">
|
||
jQuery(function () {
|
||
SphinxRtdTheme.Navigation.enable(true);
|
||
});
|
||
</script>
|
||
|
||
|
||
|
||
|
||
</body>
|
||
|
||
<!-- Mirrored from geohelm.docs.acugis.com/en/latest/components/createdb/index.html by HTTrack Website Copier/3.x [XR&CO'2014], Thu, 13 Jul 2023 23:22:02 GMT -->
|
||
</html> |