<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://www.smithnet.org.uk/wiki/index.php?action=history&amp;feed=atom&amp;title=Linux_-_Databases</id>
	<title>Linux - Databases - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.smithnet.org.uk/wiki/index.php?action=history&amp;feed=atom&amp;title=Linux_-_Databases"/>
	<link rel="alternate" type="text/html" href="https://www.smithnet.org.uk/wiki/index.php?title=Linux_-_Databases&amp;action=history"/>
	<updated>2026-05-21T09:05:02Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.1</generator>
	<entry>
		<id>https://www.smithnet.org.uk/wiki/index.php?title=Linux_-_Databases&amp;diff=1314&amp;oldid=prev</id>
		<title>NickPGSmith: /* Upgrades */</title>
		<link rel="alternate" type="text/html" href="https://www.smithnet.org.uk/wiki/index.php?title=Linux_-_Databases&amp;diff=1314&amp;oldid=prev"/>
		<updated>2025-05-12T05:41:42Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Upgrades&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en-GB&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 05:41, 12 May 2025&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l50&quot;&gt;Line 50:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 50:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;remove old database:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;remove old database:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  rm -rf /var/lib/pgsql/data-old&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  rm -rf /var/lib/pgsql/data-old&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Update collation version:&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; reindex database wiki;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; alter database wiki REFRESH COLLATION VERSION;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== psql ===&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== psql ===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key wiki-wiki-:diff:1.41:old-260:rev-1314:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>NickPGSmith</name></author>
	</entry>
	<entry>
		<id>https://www.smithnet.org.uk/wiki/index.php?title=Linux_-_Databases&amp;diff=260&amp;oldid=prev</id>
		<title>NickPGSmith: 3 revisions imported</title>
		<link rel="alternate" type="text/html" href="https://www.smithnet.org.uk/wiki/index.php?title=Linux_-_Databases&amp;diff=260&amp;oldid=prev"/>
		<updated>2024-05-08T04:53:36Z</updated>

		<summary type="html">&lt;p&gt;3 revisions imported&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en-GB&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 04:53, 8 May 2024&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en-GB&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>NickPGSmith</name></author>
	</entry>
	<entry>
		<id>https://www.smithnet.org.uk/wiki/index.php?title=Linux_-_Databases&amp;diff=259&amp;oldid=prev</id>
		<title>NickPGSmith: /* Upgrades */</title>
		<link rel="alternate" type="text/html" href="https://www.smithnet.org.uk/wiki/index.php?title=Linux_-_Databases&amp;diff=259&amp;oldid=prev"/>
		<updated>2023-05-08T20:12:16Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Upgrades&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en-GB&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 20:12, 8 May 2023&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l44&quot;&gt;Line 44:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 44:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Also, reindex.with [https://www.postgresql.org/docs/12/app-reindexdb.html reindexdb] or [https://www.postgresql.org/docs/12/sql-reindex.html REINDEX].&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Also, reindex.with [https://www.postgresql.org/docs/12/app-reindexdb.html reindexdb] or [https://www.postgresql.org/docs/12/sql-reindex.html REINDEX].&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; reindex -h localhost -U postgres&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; vacuumdb h localhost -U postgres --all --analyze-in-stages&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;remove old database:&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; rm -rf /var/lib/pgsql/data-old&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== psql ===&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== psql ===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>NickPGSmith</name></author>
	</entry>
	<entry>
		<id>https://www.smithnet.org.uk/wiki/index.php?title=Linux_-_Databases&amp;diff=258&amp;oldid=prev</id>
		<title>NickPGSmith: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="https://www.smithnet.org.uk/wiki/index.php?title=Linux_-_Databases&amp;diff=258&amp;oldid=prev"/>
		<updated>2023-02-17T21:02:12Z</updated>

		<summary type="html">&lt;p&gt;1 revision imported&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en-GB&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 21:02, 17 February 2023&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en-GB&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>NickPGSmith</name></author>
	</entry>
	<entry>
		<id>https://www.smithnet.org.uk/wiki/index.php?title=Linux_-_Databases&amp;diff=257&amp;oldid=prev</id>
		<title>NickPGSmith at 08:56, 26 August 2022</title>
		<link rel="alternate" type="text/html" href="https://www.smithnet.org.uk/wiki/index.php?title=Linux_-_Databases&amp;diff=257&amp;oldid=prev"/>
		<updated>2022-08-26T08:56:10Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== MySQL ==&lt;br /&gt;
&lt;br /&gt;
After install: mysqladmin -u root password &amp;#039;newpassword&amp;#039;&lt;br /&gt;
* /etc/my.cnf&lt;br /&gt;
&lt;br /&gt;
== Postgres ==&lt;br /&gt;
&lt;br /&gt;
See also [https://fedoraproject.org/wiki/PostgreSQL here].&lt;br /&gt;
&lt;br /&gt;
=== Initialisation ===&lt;br /&gt;
&lt;br /&gt;
Install Packages:&lt;br /&gt;
* postgresql-server postgresql-libs postgresql postgresql-contribsystem php-pgsql postgresql-devel php-pecl-apcu&lt;br /&gt;
Also for python:&lt;br /&gt;
* python-devel redhat-rpm-config python3-postgresql&lt;br /&gt;
&lt;br /&gt;
 postgresql-setup --initdb&lt;br /&gt;
 firewall-cmd --permanent --add-port=5432/tcp&lt;br /&gt;
&lt;br /&gt;
Suggested changes to postgresql.conf:&lt;br /&gt;
 listen_addresses = &amp;#039;*&amp;#039;&lt;br /&gt;
 password_encryption = scram-sha-256&lt;br /&gt;
 shared_buffers = 256MB&lt;br /&gt;
 work_mem = 64MB&lt;br /&gt;
 effective_cache_size = 4GB # Not allocation: guide to OS cache size&lt;br /&gt;
&lt;br /&gt;
Temporary setting in pg_hba.conf to allow local postgres connection:&lt;br /&gt;
 local    all            all       trust&lt;br /&gt;
&lt;br /&gt;
 su - postgres&lt;br /&gt;
 psql&lt;br /&gt;
&lt;br /&gt;
then change postgres user&amp;#039;s password. These entries set password-based authentication:&lt;br /&gt;
 host    all             all              127.0.0.1/32           scram-sha-256&lt;br /&gt;
 host    all             all              ::1/128                scram-sha-256&lt;br /&gt;
 host    all             all              192.168.1.0/24         scram-sha-256&lt;br /&gt;
 host    everywheredb    all              0.0.0.0/0              scram-sha-256&lt;br /&gt;
 host    everywheredb    all              ::0/0                  scram-sha-256&lt;br /&gt;
&lt;br /&gt;
=== Upgrades ===&lt;br /&gt;
&lt;br /&gt;
After major upgrades (requires package postgresql-upgrade):&lt;br /&gt;
 postgresql-setup --upgrade&lt;br /&gt;
&lt;br /&gt;
Also, reindex.with [https://www.postgresql.org/docs/12/app-reindexdb.html reindexdb] or [https://www.postgresql.org/docs/12/sql-reindex.html REINDEX].&lt;br /&gt;
&lt;br /&gt;
=== psql ===&lt;br /&gt;
&lt;br /&gt;
 psql -h localhost -U someuser dbname&lt;br /&gt;
&lt;br /&gt;
See also [https://www.postgresql.org/docs/current/static/app-psql.html here] for meta-commands:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
&lt;br /&gt;
!Meta Command&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|\list [pattern]&lt;br /&gt;
|List databases&lt;br /&gt;
|-&lt;br /&gt;
|\connect somedatabase&lt;br /&gt;
|Connect to somedatabase&lt;br /&gt;
|-&lt;br /&gt;
|\d[+] [pattern]&lt;br /&gt;
|Show all tables, views, sequences, etc&lt;br /&gt;
|-&lt;br /&gt;
|\d+ [tablename]&lt;br /&gt;
|Describe the table&lt;br /&gt;
|-&lt;br /&gt;
|\l+ [pattern]&lt;br /&gt;
|Show all databases&lt;br /&gt;
|-&lt;br /&gt;
|\dn&lt;br /&gt;
|Show all schemas&lt;br /&gt;
|-&lt;br /&gt;
|\dt&lt;br /&gt;
|Show details of tables&lt;br /&gt;
|-&lt;br /&gt;
|\du[+] [pattern]&lt;br /&gt;
|Show all users (roles)&lt;br /&gt;
|-&lt;br /&gt;
|\i /somepath/somefile.sql&lt;br /&gt;
|Execute commands from file&lt;br /&gt;
|-&lt;br /&gt;
|\password&lt;br /&gt;
|Change password&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Dump data from a query to CSV:&lt;br /&gt;
 \copy (select * from sometable) to &amp;#039;/tmp/somefile.csv&amp;#039; with csv delimiter &amp;#039;,&amp;#039;;&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;public&amp;quot; schema always exists.&lt;br /&gt;
* show search_path;&lt;br /&gt;
* Template1 copied when a new database is created&lt;br /&gt;
&lt;br /&gt;
=== Useful SQL ===&lt;br /&gt;
&lt;br /&gt;
Create user (aka &amp;quot;role&amp;quot;):&lt;br /&gt;
 CREATE USER jsmith WITH nocreatedb nocreaterole nosuperuser PASSWORD &amp;#039;secret&amp;#039;;&lt;br /&gt;
 GRANT ALL PRIVILEGES ON DATABASE &amp;quot;dbname&amp;quot; TO jsmith;&lt;br /&gt;
&lt;br /&gt;
Change password:&lt;br /&gt;
 ALTER USER jsmith WITH PASSWORD &amp;#039;secret&amp;#039;;&lt;br /&gt;
&lt;br /&gt;
Add privileges:&lt;br /&gt;
 GRANT USAGE ON SCHEMA sales to jsmith;&lt;br /&gt;
 GRANT CREATE ON SCHEMA sales to jsmith;&lt;br /&gt;
&lt;br /&gt;
Show shadow table:&lt;br /&gt;
 SELECT * FROM PG_SHADOW;&lt;br /&gt;
&lt;br /&gt;
Drop all tables in a schema:&lt;br /&gt;
 SELECT &amp;#039;DROP TABLE IF EXISTS &amp;quot;&amp;#039; || tablename || &amp;#039;&amp;quot; CASCADE;&amp;#039; &lt;br /&gt;
 FROM pg_tables&lt;br /&gt;
 WHERE schemaname = &amp;#039;public&amp;#039;;&lt;br /&gt;
&lt;br /&gt;
Change owner of table:&lt;br /&gt;
 ALTER TABLE mathoid OWNER TO WIKI;&lt;br /&gt;
&lt;br /&gt;
=== Backup and Restore ===&lt;br /&gt;
&lt;br /&gt;
 pg_dump -h localhost -p 5432 -d DATABASE -U postgres -f /tmp/db.dmp&lt;br /&gt;
 psql -h localhost -p 5432 -d DATABASE -U postgres &amp;lt; /tmp/db.dmp&lt;br /&gt;
&lt;br /&gt;
=== Admin Console ===&lt;br /&gt;
&lt;br /&gt;
Use the [https://www.pgadmin.org/download/windows.php PGAdmin] Console.&lt;/div&gt;</summary>
		<author><name>NickPGSmith</name></author>
	</entry>
</feed>