From f596268c32e038b1667e4fca3217ae8111b4a1b3 Mon Sep 17 00:00:00 2001 From: Matthias Wirtz Date: Fri, 26 Sep 2025 11:40:07 +0200 Subject: [PATCH 1/2] officially support postgres 18, add docs for volume mount change --- .github/workflows/elixir_test.yml | 2 +- lib/teslamate/database_check.ex | 5 +++-- website/docs/advanced_guides/apache.md | 4 ++-- website/docs/advanced_guides/traefik.md | 4 ++-- website/docs/development.mdx | 2 +- website/docs/installation/docker.md | 4 ++-- website/docs/installation/unsupported/debian.md | 4 ++-- website/docs/installation/unsupported/freebsd.md | 6 +++--- website/docs/maintenance/upgrading_postgres.md | 7 +++++-- 9 files changed, 21 insertions(+), 17 deletions(-) diff --git a/.github/workflows/elixir_test.yml b/.github/workflows/elixir_test.yml index c3a05d765f..4a563f5301 100644 --- a/.github/workflows/elixir_test.yml +++ b/.github/workflows/elixir_test.yml @@ -21,7 +21,7 @@ jobs: services: db: - image: postgres:17 + image: postgres:18-trixie ports: ["5432:5432"] env: POSTGRES_PASSWORD: postgres diff --git a/lib/teslamate/database_check.ex b/lib/teslamate/database_check.ex index 949b6b003f..e5e3444782 100644 --- a/lib/teslamate/database_check.ex +++ b/lib/teslamate/database_check.ex @@ -8,7 +8,8 @@ defmodule TeslaMate.DatabaseCheck do @version_requirements %{ 1600 => %{min_version: "16.7", min_version_num: 160_007}, - 1700 => %{min_version: "17.3", min_version_num: 170_003} + 1700 => %{min_version: "17.3", min_version_num: 170_003}, + 1800 => %{min_version: "18.0", min_version_num: 180_000} } def check_postgres_version do @@ -49,7 +50,7 @@ defmodule TeslaMate.DatabaseCheck do version_num: version_num }) do cond do - major > 1700 -> + major > 1800 -> IO.puts( "PostgreSQL version #{version} is not officially tested or supported yet. Use at your own risk." ) diff --git a/website/docs/advanced_guides/apache.md b/website/docs/advanced_guides/apache.md index d18c8e0ca4..8ac20f45e9 100644 --- a/website/docs/advanced_guides/apache.md +++ b/website/docs/advanced_guides/apache.md @@ -50,14 +50,14 @@ services: - all database: - image: postgres:17 + image: postgres:18-trixie restart: always environment: - POSTGRES_USER=${TM_DB_USER} - POSTGRES_PASSWORD=${TM_DB_PASS} - POSTGRES_DB=${TM_DB_NAME} volumes: - - teslamate-db:/var/lib/postgresql/data + - teslamate-db:/var/lib/postgresql grafana: image: teslamate/grafana:latest diff --git a/website/docs/advanced_guides/traefik.md b/website/docs/advanced_guides/traefik.md index c4c8dfa8a9..1f47e64e89 100644 --- a/website/docs/advanced_guides/traefik.md +++ b/website/docs/advanced_guides/traefik.md @@ -57,14 +57,14 @@ services: - ALL database: - image: postgres:17 + image: postgres:18-trixie restart: always environment: - POSTGRES_USER=${TM_DB_USER} - POSTGRES_PASSWORD=${TM_DB_PASS} - POSTGRES_DB=${TM_DB_NAME} volumes: - - teslamate-db:/var/lib/postgresql/data + - teslamate-db:/var/lib/postgresql grafana: image: teslamate/grafana:latest diff --git a/website/docs/development.mdx b/website/docs/development.mdx index bb3bdcdfad..6d59762f3c 100644 --- a/website/docs/development.mdx +++ b/website/docs/development.mdx @@ -183,7 +183,7 @@ To quickly identify performance bottlenecks we encourage all contributors to ena ```yml services: database: - image: postgres:17 + image: postgres:18-trixie ... command: postgres -c shared_preload_libraries=pg_stat_statements ... diff --git a/website/docs/installation/docker.md b/website/docs/installation/docker.md index 0c709514e4..a075c38b80 100644 --- a/website/docs/installation/docker.md +++ b/website/docs/installation/docker.md @@ -40,14 +40,14 @@ Alternatively, you can use a reverse proxy (such as Traefik, Apache2 or Caddy) w - all database: - image: postgres:17-trixie + image: postgres:18-trixie restart: always environment: - POSTGRES_USER=teslamate - POSTGRES_PASSWORD=password #insert your secure database password! - POSTGRES_DB=teslamate volumes: - - teslamate-db:/var/lib/postgresql/data + - teslamate-db:/var/lib/postgresql grafana: image: teslamate/grafana:latest diff --git a/website/docs/installation/unsupported/debian.md b/website/docs/installation/unsupported/debian.md index 0480fbefd6..8f79f80d24 100644 --- a/website/docs/installation/unsupported/debian.md +++ b/website/docs/installation/unsupported/debian.md @@ -12,7 +12,7 @@ Click on the following items to view detailed installation steps. Note that in very recent distributions, you might have the required versions already packaged. However, the contents or naming of the Debian/Ubuntu packages might slightly differ than the ones from upstream, so you might need to install extra packages or do other tweaks.
- Postgres (v17.3+) + Postgres (v16.7+, v17.3+ or v18.0+) Either upstream: @@ -20,7 +20,7 @@ Either upstream: wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" | sudo tee /etc/apt/sources.list.d/pgdg.list sudo apt-get update -sudo apt-get install -y postgresql-17 postgresql-client-17 +sudo apt-get install -y postgresql-18 postgresql-client-18 ``` Source: [postgresql.org/download](https://www.postgresql.org/download/) diff --git a/website/docs/installation/unsupported/freebsd.md b/website/docs/installation/unsupported/freebsd.md index bc777c80b0..2ed887d37f 100644 --- a/website/docs/installation/unsupported/freebsd.md +++ b/website/docs/installation/unsupported/freebsd.md @@ -50,11 +50,11 @@ pkg install elixir
- Postgres (v17.3+) + Postgres (v16.7+, v17.3+ or v18.0+) ```bash -pkg install postgresql17-server -pkg install postgresql17-contrib +pkg install postgresql18-server +pkg install postgresql18-contrib echo postgres_enable="yes" >> /etc/rc.conf ``` diff --git a/website/docs/maintenance/upgrading_postgres.md b/website/docs/maintenance/upgrading_postgres.md index 208dd261da..ecba531413 100644 --- a/website/docs/maintenance/upgrading_postgres.md +++ b/website/docs/maintenance/upgrading_postgres.md @@ -16,11 +16,14 @@ sidebar_label: Upgrading PostgreSQL docker volume rm "$(basename "$PWD")_teslamate-db" ``` -4. Change the postgres version in docker-compose.yml and start the container +4. Change the postgres version and ensure your volume mount is [configured correctly](https://hub.docker.com/_/postgres#pgdata) in docker-compose.yml and start the container ```yml {2} database: - image: postgres:xx-trixie + image: postgres:18-trixie + ... + volumes: + - teslamate-db:/var/lib/postgresql ``` ```bash From cd62206dae829e9803b278733a6b54558f05463f Mon Sep 17 00:00:00 2001 From: Matthias Wirtz Date: Sun, 26 Oct 2025 08:29:21 +0100 Subject: [PATCH 2/2] docs: update changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 35eaa9c4c0..bf43bbd69f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ - fix: allow using different PostgreSQL port than default when using socket_dir connection (#4979 - @jaypark0006) - perf: use anti join for short-circuit evaluation when getting non streamed drives (#4990 - @swiffer) - feat: Add ulimit cap to prevent memory bloat in some misconfigured versions of Docker/containerd Hosts (e.g. on Debian 13) (#5025 - @JakobLichterfeld) +- feat: officially support PostgreSQL 18 (#4890 - @swiffer) #### Build, CI, internal @@ -54,6 +55,7 @@ - docs: add domain prefix to Home Assistant default_entity_id (#5014 - @gym22) - docs: add star history (#5024 - @JakobLichterfeld) - docs: bump Traefik to v3.5 and enable http3 in advanced guide (#5023 - @swiffer) +- docs: add docs for volume mount change with PostgreSQL 18 (#4890 - @swiffer) ## [2.1.1] - 2025-08-16