diff --git a/synapse/README.md b/synapse/README.md index b3e6bac..ac59da7 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: + 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