From abf672101ae79faac7be9f2f8ec6e7626237771c Mon Sep 17 00:00:00 2001
From: Hans van Zijst <hans@procolix.com>
Date: Mon, 4 Nov 2024 17:18:18 +0100
Subject: [PATCH] Added switch from sqlite to pg.

---
 synapse/README.md | 40 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)

diff --git a/synapse/README.md b/synapse/README.md
index b3e6bac0..ac59da73 100644
--- a/synapse/README.md
+++ b/synapse/README.md
@@ -49,6 +49,46 @@ unsuitable for a production environment.
 
 [Here's how you setup PostgreSQL](../postgresql).
 
+Once you've created a database and user in PostgreSQL, you configure Synapse
+to use it.
+
+First delete (or comment out) the SQLITE datbase in `homeserver.yaml`:
+
+```
+#database:
+#  name: sqlite3
+#  args:
+#    database: /var/lib/matrix-synapse/homeserver.db
+```
+
+Then create the database configuration for PostgreSQL in
+`conf.d/database.yaml`:
+
+```
+database:
+  name: psycopg2
+  args:
+    user: synapse
+    password: <password>
+    dbname: synapse
+    host: /var/run/postgresql
+    cp_min: 5
+    cp_max: 10
+```
+
+Note: you configure the directory where the UNIX socket file lives, not the
+actual file.
+
+Of course, if you use localhost, you should configure it like this:
+
+```
+    host: localhost
+    port: 5432
+```
+
+After changing the database, restart Synapse and check whether it can connect
+and create the tables it needs.
+
 
 # Logging