Added switch from sqlite to pg.

This commit is contained in:
Hans van Zijst 2024-11-04 17:18:18 +01:00
parent 125bfb3892
commit abf672101a
Signed by untrusted user: hans
GPG key ID: 43DBCC37BFDEFD72

View file

@ -49,6 +49,46 @@ unsuitable for a production environment.
[Here's how you setup PostgreSQL](../postgresql). [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 # Logging