summary refs log tree commit diff
path: root/synapse/storage/engines
diff options
context:
space:
mode:
authorAmber Brown <hawkowl@atleastfornow.net>2019-06-18 00:59:00 +1000
committerGitHub <noreply@github.com>2019-06-18 00:59:00 +1000
commiteba7caf09fe9bb5f5a0d4b17c5dde1413343cadc (patch)
treec1c6772ccd74da04a5e68d76340f5ab938fffe3b /synapse/storage/engines
parentMerge pull request #5385 from matrix-org/erikj/reduce_http_exceptions (diff)
downloadsynapse-eba7caf09fe9bb5f5a0d4b17c5dde1413343cadc.tar.xz
Remove Postgres 9.4 support (#5448)
Diffstat (limited to 'synapse/storage/engines')
-rw-r--r--synapse/storage/engines/postgres.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/synapse/storage/engines/postgres.py b/synapse/storage/engines/postgres.py
index 1b97ee74e3..289b6bc281 100644
--- a/synapse/storage/engines/postgres.py
+++ b/synapse/storage/engines/postgres.py
@@ -45,6 +45,10 @@ class PostgresEngine(object):
         # together. For example, version 8.1.5 will be returned as 80105
         self._version = db_conn.server_version
 
+        # Are we on a supported PostgreSQL version?
+        if self._version < 90500:
+            raise RuntimeError("Synapse requires PostgreSQL 9.5+ or above.")
+
         db_conn.set_isolation_level(
             self.module.extensions.ISOLATION_LEVEL_REPEATABLE_READ
         )
@@ -64,9 +68,9 @@ class PostgresEngine(object):
     @property
     def can_native_upsert(self):
         """
-        Can we use native UPSERTs? This requires PostgreSQL 9.5+.
+        Can we use native UPSERTs?
         """
-        return self._version >= 90500
+        return True
 
     def is_deadlock(self, error):
         if isinstance(error, self.module.DatabaseError):