File size: 10,490 Bytes
66b3b8e | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 |
<!DOCTYPE html>
<html lang="en" data-content_root="./">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<title>External database for pgAdmin user settings — pgAdmin 4 8.6 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=fa44fd50" />
<link rel="stylesheet" type="text/css" href="_static/style.css?v=d36593c3" />
<script src="_static/documentation_options.js?v=d4c83366"></script>
<script src="_static/doctools.js?v=9a2dae69"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/sidebar.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="Connecting To A Server" href="connecting.html" />
<link rel="prev" title="Search objects" href="search_objects.html" />
</head><body>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="connecting.html" title="Connecting To A Server"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="search_objects.html" title="Search objects"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">pgAdmin 4 8.6 documentation</a> »</li>
<li class="nav-item nav-item-this"><a href="">External database for pgAdmin user settings</a></li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<section id="external-database-for-pgadmin-user-settings">
<span id="external-database"></span><h1><span class="target" id="index-0"></span>External database for pgAdmin user settings<a class="headerlink" href="#external-database-for-pgadmin-user-settings" title="Link to this heading">¶</a></h1>
<p>The user settings used by pgAdmin are stored in a SQLite database. In this
database, many settings are stored, such as preferences, user accounts,
auto-discovered servers, and many more.</p>
<p>As SQLite is a file-based database and it can be anywhere in the file system,
so it is not designed to take care of failures (no HA support). Furthermore,
it isn’t designed to handle multiple connections concurrently reading/writing
data to it. Example: In environments such as Kubernetes it may be useful to
use an alternate backend to avoid using SQLite on non-ephemeral storage and to
allow HA of the settings database.</p>
<p>In order to prevent this, pgAdmin now supports storing user settings in an
external database using the new ‘CONFIG_DATABASE_URI’ parameter in the
<a class="reference internal" href="config_py.html#config-py"><span class="std std-ref">config.py</span></a> file.</p>
<section id="use-sqlite-database">
<h2>Use SQLite Database<a class="headerlink" href="#use-sqlite-database" title="Link to this heading">¶</a></h2>
<p>In order to use SQLite Database, make sure CONFIG_DATABASE_URI parameter is
set to an empty string like ‘’. By default it is set to an empty string in the
config.py so if you would like to use SQLite database then no need to change
anything.</p>
</section>
<section id="use-external-database">
<h2>Use External Database<a class="headerlink" href="#use-external-database" title="Link to this heading">¶</a></h2>
<p>In order to use an external database, make sure CONFIG_DATABASE_URI parameter
is set like “dialect+driver://username:password@host:port/database”.</p>
<p><strong>Note</strong> It is recommended to create the database in advance.</p>
</section>
<section id="use-postgresql-database">
<h2>Use PostgreSQL Database<a class="headerlink" href="#use-postgresql-database" title="Link to this heading">¶</a></h2>
<p>Following are the formats to use PostgreSQL as an external database.</p>
<p>Basic syntax:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>postgresql://username:password@host:port/database
</pre></div>
</div>
<p>Using specific schema (It is recommended to create the schema in advance):</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>postgresql://username:password@host:port/database?options<span class="o">=</span>-csearch_path<span class="o">=</span><schema<span class="w"> </span>name>
</pre></div>
</div>
<p>Using default pgpass path for the service account:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>postgresql://username@host:port?options<span class="o">=</span>-csearch_path<span class="o">=</span><schema<span class="w"> </span>name>
</pre></div>
</div>
<p>Specifying pgpass file path:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>postgresql://username@host:port?passfile<span class="o">=</span><path<span class="w"> </span>of<span class="w"> </span>the<span class="w"> </span>pgpass<span class="w"> </span>file><span class="p">&</span><span class="nv">options</span><span class="o">=</span>-csearch_path<span class="o">=</span><schema<span class="w"> </span>name>
</pre></div>
</div>
</section>
</section>
<div class="clearer"></div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<div>
<h3><a href="index.html">Table of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">External database for pgAdmin user settings</a><ul>
<li><a class="reference internal" href="#use-sqlite-database">Use SQLite Database</a></li>
<li><a class="reference internal" href="#use-external-database">Use External Database</a></li>
<li><a class="reference internal" href="#use-postgresql-database">Use PostgreSQL Database</a></li>
</ul>
</li>
</ul>
</div>
<h3><a href="index.html">Table of Contents</a></h3>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="getting_started.html">Getting Started</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">External database for pgAdmin user settings</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#use-sqlite-database">Use SQLite Database</a></li>
<li class="toctree-l2"><a class="reference internal" href="#use-external-database">Use External Database</a></li>
<li class="toctree-l2"><a class="reference internal" href="#use-postgresql-database">Use PostgreSQL Database</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="connecting.html">Connecting To A Server</a></li>
<li class="toctree-l1"><a class="reference internal" href="managing_cluster_objects.html">Managing Cluster Objects</a></li>
<li class="toctree-l1"><a class="reference internal" href="managing_database_objects.html">Managing Database Objects</a></li>
<li class="toctree-l1"><a class="reference internal" href="modifying_tables.html">Creating or Modifying a Table</a></li>
<li class="toctree-l1"><a class="reference internal" href="management_basics.html">Management Basics</a></li>
<li class="toctree-l1"><a class="reference internal" href="backup_and_restore.html">Backup and Restore</a></li>
<li class="toctree-l1"><a class="reference internal" href="developer_tools.html">Developer Tools</a></li>
<li class="toctree-l1"><a class="reference internal" href="processes.html">Processes</a></li>
<li class="toctree-l1"><a class="reference internal" href="pgagent.html">pgAgent</a></li>
<li class="toctree-l1"><a class="reference internal" href="contributions.html">pgAdmin Project Contributions</a></li>
<li class="toctree-l1"><a class="reference internal" href="release_notes.html">Release Notes</a></li>
<li class="toctree-l1"><a class="reference internal" href="licence.html">Licence</a></li>
</ul>
<search id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
<input type="submit" value="Go" />
</form>
</div>
</search>
<script>document.getElementById('searchbox').style.display = "block"</script>
</div>
<div id="sidebarbutton" title="Collapse sidebar">
<span>«</span>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="connecting.html" title="Connecting To A Server"
>next</a> |</li>
<li class="right" >
<a href="search_objects.html" title="Search objects"
>previous</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">pgAdmin 4 8.6 documentation</a> »</li>
<li class="nav-item nav-item-this"><a href="">External database for pgAdmin user settings</a></li>
</ul>
</div>
<div class="footer" role="contentinfo">
<div class="related" role="navigation" aria-label="related navigation">
<ul>
<li class="left" style="margin-left: 10px">© Copyright (C) 2013 - 2024, The pgAdmin Development Team.</li>
<li class="right" style="margin-right: 10px"><a href="genindex.html" title="General Index" accesskey="I">index</a></li>
<li class="right" ><a href="connecting.html" title="Connecting To A Server" accesskey="N">next</a> |</li>
<li class="right" ><a href="search_objects.html" title="Search objects" accesskey="P">previous</a> |</li>
</ul>
</div>
</div>
</body>
</html> |