Skip to content

Commit 50423e3

Browse files
authored
feat: officially support postgres 18, add docs for volume mount change (#4890)
* officially support postgres 18, add docs for volume mount change * docs: update changelog
1 parent 302475d commit 50423e3

File tree

10 files changed

+23
-17
lines changed

10 files changed

+23
-17
lines changed

.github/workflows/elixir_test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121

2222
services:
2323
db:
24-
image: postgres:17
24+
image: postgres:18-trixie
2525
ports: ["5432:5432"]
2626
env:
2727
POSTGRES_PASSWORD: postgres

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
- fix: allow using different PostgreSQL port than default when using socket_dir connection (#4979 - @jaypark0006)
1414
- perf: use anti join for short-circuit evaluation when getting non streamed drives (#4990 - @swiffer)
1515
- feat: Add ulimit cap to prevent memory bloat in some misconfigured versions of Docker/containerd Hosts (e.g. on Debian 13) (#5025 - @JakobLichterfeld)
16+
- feat: officially support PostgreSQL 18 (#4890 - @swiffer)
1617

1718
#### Build, CI, internal
1819

@@ -54,6 +55,7 @@
5455
- docs: add domain prefix to Home Assistant default_entity_id (#5014 - @gym22)
5556
- docs: add star history (#5024 - @JakobLichterfeld)
5657
- docs: bump Traefik to v3.5 and enable http3 in advanced guide (#5023 - @swiffer)
58+
- docs: add docs for volume mount change with PostgreSQL 18 (#4890 - @swiffer)
5759

5860
## [2.1.1] - 2025-08-16
5961

lib/teslamate/database_check.ex

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ defmodule TeslaMate.DatabaseCheck do
88

99
@version_requirements %{
1010
1600 => %{min_version: "16.7", min_version_num: 160_007},
11-
1700 => %{min_version: "17.3", min_version_num: 170_003}
11+
1700 => %{min_version: "17.3", min_version_num: 170_003},
12+
1800 => %{min_version: "18.0", min_version_num: 180_000}
1213
}
1314

1415
def check_postgres_version do
@@ -49,7 +50,7 @@ defmodule TeslaMate.DatabaseCheck do
4950
version_num: version_num
5051
}) do
5152
cond do
52-
major > 1700 ->
53+
major > 1800 ->
5354
IO.puts(
5455
"PostgreSQL version #{version} is not officially tested or supported yet. Use at your own risk."
5556
)

website/docs/advanced_guides/apache.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,14 @@ services:
5050
- all
5151

5252
database:
53-
image: postgres:17
53+
image: postgres:18-trixie
5454
restart: always
5555
environment:
5656
- POSTGRES_USER=${TM_DB_USER}
5757
- POSTGRES_PASSWORD=${TM_DB_PASS}
5858
- POSTGRES_DB=${TM_DB_NAME}
5959
volumes:
60-
- teslamate-db:/var/lib/postgresql/data
60+
- teslamate-db:/var/lib/postgresql
6161

6262
grafana:
6363
image: teslamate/grafana:latest

website/docs/advanced_guides/traefik.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,14 @@ services:
5757
- ALL
5858

5959
database:
60-
image: postgres:17
60+
image: postgres:18-trixie
6161
restart: always
6262
environment:
6363
- POSTGRES_USER=${TM_DB_USER}
6464
- POSTGRES_PASSWORD=${TM_DB_PASS}
6565
- POSTGRES_DB=${TM_DB_NAME}
6666
volumes:
67-
- teslamate-db:/var/lib/postgresql/data
67+
- teslamate-db:/var/lib/postgresql
6868

6969
grafana:
7070
image: teslamate/grafana:latest

website/docs/development.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ To quickly identify performance bottlenecks we encourage all contributors to ena
183183
```yml
184184
services:
185185
database:
186-
image: postgres:17
186+
image: postgres:18-trixie
187187
...
188188
command: postgres -c shared_preload_libraries=pg_stat_statements
189189
...

website/docs/installation/docker.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,14 @@ Alternatively, you can use a reverse proxy (such as Traefik, Apache2 or Caddy) w
4040
- all
4141

4242
database:
43-
image: postgres:17-trixie
43+
image: postgres:18-trixie
4444
restart: always
4545
environment:
4646
- POSTGRES_USER=teslamate
4747
- POSTGRES_PASSWORD=password #insert your secure database password!
4848
- POSTGRES_DB=teslamate
4949
volumes:
50-
- teslamate-db:/var/lib/postgresql/data
50+
- teslamate-db:/var/lib/postgresql
5151

5252
grafana:
5353
image: teslamate/grafana:latest

website/docs/installation/unsupported/debian.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ Click on the following items to view detailed installation steps.
1212
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.
1313

1414
<details>
15-
<summary>Postgres (v17.3+)</summary>
15+
<summary>Postgres (v16.7+, v17.3+ or v18.0+)</summary>
1616

1717
Either upstream:
1818

1919
```bash
2020
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
2121
echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" | sudo tee /etc/apt/sources.list.d/pgdg.list
2222
sudo apt-get update
23-
sudo apt-get install -y postgresql-17 postgresql-client-17
23+
sudo apt-get install -y postgresql-18 postgresql-client-18
2424
```
2525

2626
Source: [postgresql.org/download](https://www.postgresql.org/download/)

website/docs/installation/unsupported/freebsd.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,11 @@ pkg install elixir
5050
</details>
5151

5252
<details>
53-
<summary>Postgres (v17.3+)</summary>
53+
<summary>Postgres (v16.7+, v17.3+ or v18.0+)</summary>
5454

5555
```bash
56-
pkg install postgresql17-server
57-
pkg install postgresql17-contrib
56+
pkg install postgresql18-server
57+
pkg install postgresql18-contrib
5858
echo postgres_enable="yes" >> /etc/rc.conf
5959
```
6060

website/docs/maintenance/upgrading_postgres.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,14 @@ sidebar_label: Upgrading PostgreSQL
1616
docker volume rm "$(basename "$PWD")_teslamate-db"
1717
```
1818

19-
4. Change the postgres version in docker-compose.yml and start the container
19+
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
2020

2121
```yml {2}
2222
database:
23-
image: postgres:xx-trixie
23+
image: postgres:18-trixie
24+
...
25+
volumes:
26+
- teslamate-db:/var/lib/postgresql
2427
```
2528
2629
```bash

0 commit comments

Comments
 (0)