Skip to content

Commit 5d545d1

Browse files
authored
Remove support for PostgreSQL 13 (#19170)
This PR removes support for PostgreSQL 13 as it is deprecated (tomorrow). Uses #18034 as a reference of where to look, and also found a few other places that needed updating. I didn't see anywhere in Complement that needs updating. There is a companion Sytest PR deprecating psql13 over there: matrix-org/sytest#1418 ### Pull Request Checklist <!-- Please read https://element-hq.github.io/synapse/latest/development/contributing_guide.html before submitting your pull request --> * [X] Pull request is based on the develop branch * [X] Pull request includes a [changelog file](https://element-hq.github.io/synapse/latest/development/contributing_guide.html#changelog). The entry should: - Be a short description of your change which makes sense to users. "Fixed a bug that prevented receiving messages from other servers." instead of "Moved X method from `EventStore` to `EventWorkerStore`.". - Use markdown where necessary, mostly for `code blocks`. - End with either a period (.) or an exclamation mark (!). - Start with a capital letter. - Feel free to credit yourself, by adding a sentence "Contributed by @github_username." or "Contributed by [Your Name]." to the end of the entry. * [X] [Code style](https://element-hq.github.io/synapse/latest/code_style.html) is correct (run the [linters](https://element-hq.github.io/synapse/latest/development/contributing_guide.html#run-the-linters))
1 parent 9e23cde commit 5d545d1

6 files changed

Lines changed: 15 additions & 6 deletions

File tree

.ci/scripts/calculate_jobs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def set_output(key: str, value: str):
7272
{
7373
"python-version": "3.10",
7474
"database": "postgres",
75-
"postgres-version": "13",
75+
"postgres-version": "14",
7676
"extras": "all",
7777
},
7878
{

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,7 @@ jobs:
617617
matrix:
618618
include:
619619
- python-version: "3.10"
620-
postgres-version: "13"
620+
postgres-version: "14"
621621

622622
- python-version: "3.14"
623623
postgres-version: "17"

changelog.d/19170.removal

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Remove support for PostgreSQL 13.

docker/complement/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ ARG SYNAPSE_VERSION=latest
1111
ARG FROM=matrixdotorg/synapse-workers:$SYNAPSE_VERSION
1212
ARG DEBIAN_VERSION=trixie
1313

14-
FROM docker.io/library/postgres:13-${DEBIAN_VERSION} AS postgres_base
14+
FROM docker.io/library/postgres:14-${DEBIAN_VERSION} AS postgres_base
1515

1616
FROM $FROM
1717
# First of all, we copy postgres server from the official postgres image,
@@ -26,7 +26,7 @@ RUN adduser --system --uid 999 postgres --home /var/lib/postgresql
2626
COPY --from=postgres_base /usr/lib/postgresql /usr/lib/postgresql
2727
COPY --from=postgres_base /usr/share/postgresql /usr/share/postgresql
2828
COPY --from=postgres_base --chown=postgres /var/run/postgresql /var/run/postgresql
29-
ENV PATH="${PATH}:/usr/lib/postgresql/13/bin"
29+
ENV PATH="${PATH}:/usr/lib/postgresql/14/bin"
3030
ENV PGDATA=/var/lib/postgresql/data
3131

3232
# We also initialize the database at build time, rather than runtime, so that it's faster to spin up the image.

docs/upgrade.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,14 @@ each upgrade are complete before moving on to the next upgrade, to avoid
117117
stacking them up. You can monitor the currently running background updates with
118118
[the Admin API](usage/administration/admin_api/background_updates.html#status).
119119
120+
# Upgrading to v1.143.0
121+
122+
## Dropping support for PostgreSQL 13
123+
124+
In line with our [deprecation policy](deprecation_policy.md), we've dropped
125+
support for PostgreSQL 13, as it is no longer supported upstream.
126+
This release of Synapse requires PostgreSQL 14+.
127+
120128
# Upgrading to v1.142.0
121129

122130
## Python 3.10+ is now required

synapse/storage/engines/postgres.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@ def check_database(
9999
allow_unsafe_locale = self.config.get("allow_unsafe_locale", False)
100100

101101
# Are we on a supported PostgreSQL version?
102-
if not allow_outdated_version and self._version < 130000:
103-
raise RuntimeError("Synapse requires PostgreSQL 13 or above.")
102+
if not allow_outdated_version and self._version < 140000:
103+
raise RuntimeError("Synapse requires PostgreSQL 14 or above.")
104104

105105
with db_conn.cursor() as txn:
106106
txn.execute("SHOW SERVER_ENCODING")

0 commit comments

Comments
 (0)