Skip to content

Commit 7984476

Browse files
Merge pull request #261 from thingsboard/postgres
Postgres 17
2 parents 761c1fa + 83d3fca commit 7984476

File tree

9 files changed

+18
-18
lines changed

9 files changed

+18
-18
lines changed

dao/src/test/resources/sql-test.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ spring.jpa.show-sql=false
44
spring.jpa.hibernate.ddl-auto=none
55
spring.datasource.username=postgres
66
spring.datasource.password=postgres
7-
spring.datasource.url=jdbc:tc:postgresql:16:///thingsboard_mqtt_broker?TC_DAEMON=true&TC_TMPFS=/testtmpfs:rw&?TC_INITFUNCTION=org.thingsboard.mqtt.broker.dao.PostgreSqlInitializer::initDb
7+
spring.datasource.url=jdbc:tc:postgresql:17:///thingsboard_mqtt_broker?TC_DAEMON=true&TC_TMPFS=/testtmpfs:rw&?TC_INITFUNCTION=org.thingsboard.mqtt.broker.dao.PostgreSqlInitializer::initDb
88
spring.datasource.driverClassName=org.testcontainers.jdbc.ContainerDatabaseDriver
99
spring.datasource.hikari.maximumPoolSize=16

docker/backup-restore/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ docker run --rm --network <network_name> \
5353
-v tbmq-postgres-data:/var/lib/postgresql/data \
5454
-v $(pwd)/backups:/backups \
5555
-e PGPASSWORD=postgres \
56-
postgres:16 \
56+
postgres:17 \
5757
sh -c 'pg_dump -Fc -v -h postgres -U postgres -d thingsboard_mqtt_broker > /backups/tbmq_backup.dump'
5858
```
5959

@@ -65,7 +65,7 @@ sh -c 'pg_dump -Fc -v -h postgres -U postgres -d thingsboard_mqtt_broker > /back
6565
- `-v tbmq-postgres-data:/var/lib/postgresql/data`: Mounts the PostgreSQL data volume.
6666
- `-v $(pwd)/backups:/backups`: Mounts a local directory (`./backups`) to store the backup file.
6767
- `-e PGPASSWORD=postgres`: Provides the PostgreSQL password as an environment variable.
68-
- `postgres:16`: The Docker image for PostgreSQL version 16.
68+
- `postgres:17`: The Docker image for PostgreSQL version 17.
6969
- `sh -c 'pg_dump ...'`: The shell command to run the `pg_dump` tool, which creates a compressed custom-format (`-Fc`)
7070
backup of the `thingsboard_mqtt_broker` database and saves it as `tbmq_backup.dump`.
7171

@@ -83,7 +83,7 @@ docker run --rm --network <network_name> \
8383
-v tbmq-postgres-data:/var/lib/postgresql/data \
8484
-v $(pwd)/backups:/backups \
8585
-e PGPASSWORD=postgres \
86-
postgres:16 \
86+
postgres:17 \
8787
sh -c 'pg_restore -c -h postgres -U postgres -d thingsboard_mqtt_broker -v /backups/tbmq_backup.dump'
8888
```
8989

@@ -94,7 +94,7 @@ sh -c 'pg_restore -c -h postgres -U postgres -d thingsboard_mqtt_broker -v /back
9494
- `-v tbmq-postgres-data:/var/lib/postgresql/data`: Mounts the PostgreSQL data volume.
9595
- `-v $(pwd)/backups:/backups`: Mounts the local `./backups` directory where the backup file is stored.
9696
- `-e PGPASSWORD=postgres`: Supplies the PostgreSQL password.
97-
- `postgres:16`: Uses the PostgreSQL 16 Docker image.
97+
- `postgres:17`: Uses the PostgreSQL 17 Docker image.
9898
- `sh -c 'pg_restore ...'`: The shell command runs `pg_restore` to restore the database from the `tbmq_backup.dump`
9999
file.
100100
- `-c`: Cleans (drops) existing database objects before restoring.

docker/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ services:
1818
postgres:
1919
restart: always
2020
container_name: "${POSTGRES_NAME}"
21-
image: "postgres:16"
21+
image: "postgres:17"
2222
ports:
2323
- "5432"
2424
logging:

k8s/minikube/backup-restore/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ metadata:
3232
spec:
3333
containers:
3434
- name: postgres-backup
35-
image: postgres:16
35+
image: postgres:17
3636
command:
3737
- /bin/bash
3838
- -ec
@@ -101,7 +101,7 @@ metadata:
101101
spec:
102102
containers:
103103
- name: postgres-restore
104-
image: postgres:16
104+
image: postgres:17
105105
command:
106106
- /bin/bash
107107
- -ec

k8s/minikube/backup-restore/backup.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ metadata:
2222
spec:
2323
containers:
2424
- name: postgres-backup
25-
image: postgres:16
25+
image: postgres:17
2626
command:
2727
- /bin/bash
2828
- -ec

k8s/minikube/backup-restore/restore.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ metadata:
2222
spec:
2323
containers:
2424
- name: postgres-restore
25-
image: postgres:16
25+
image: postgres:17
2626
command:
2727
- /bin/bash
2828
- -ec

k8s/minikube/postgres.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ spec:
5151
containers:
5252
- name: postgres
5353
imagePullPolicy: Always
54-
image: postgres:16
54+
image: postgres:17
5555
ports:
5656
- containerPort: 5432
5757
name: postgres

msa/tbmq/configs/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ docker run --rm --network <network_name> \
5252
-v tbmq-postgres-data:/var/lib/postgresql/data \
5353
-v $(pwd)/backups:/backups \
5454
-e PGPASSWORD=postgres \
55-
postgres:16 \
55+
postgres:17 \
5656
sh -c 'pg_dump -Fc -v -h postgres -U postgres -d thingsboard_mqtt_broker > /backups/tbmq_backup.dump'
5757
```
5858

@@ -63,7 +63,7 @@ docker run --rm --network <network_name> `
6363
-v tbmq-postgres-data:/var/lib/postgresql/data `
6464
-v ${PWD}/backups:/backups `
6565
-e PGPASSWORD=postgres `
66-
postgres:16 `
66+
postgres:17 `
6767
sh -c "pg_dump -Fc -v -h postgres -U postgres -d thingsboard_mqtt_broker > /backups/tbmq_backup.dump"
6868
```
6969

@@ -75,7 +75,7 @@ sh -c "pg_dump -Fc -v -h postgres -U postgres -d thingsboard_mqtt_broker > /back
7575
- `-v tbmq-postgres-data:/var/lib/postgresql/data`: Mounts the PostgreSQL data volume.
7676
- `-v $(pwd)/backups:/backups`: Mounts a local directory (`./backups`) to store the backup file.
7777
- `-e PGPASSWORD=postgres`: Provides the PostgreSQL password as an environment variable.
78-
- `postgres:16`: The Docker image for PostgreSQL version 16.
78+
- `postgres:17`: The Docker image for PostgreSQL version 17.
7979
- `sh -c 'pg_dump ...'`: The shell command to run the `pg_dump` tool, which creates a compressed custom-format (`-Fc`)
8080
backup of the `thingsboard_mqtt_broker` database and saves it as `tbmq_backup.dump`.
8181

@@ -93,7 +93,7 @@ docker run --rm --network <network_name> \
9393
-v tbmq-postgres-data:/var/lib/postgresql/data \
9494
-v $(pwd)/backups:/backups \
9595
-e PGPASSWORD=postgres \
96-
postgres:16 \
96+
postgres:17 \
9797
sh -c 'pg_restore -c -h postgres -U postgres -d thingsboard_mqtt_broker -v /backups/tbmq_backup.dump'
9898
```
9999

@@ -104,7 +104,7 @@ docker run --rm --network <network_name> `
104104
-v tbmq-postgres-data:/var/lib/postgresql/data `
105105
-v ${PWD}/backups:/backups `
106106
-e PGPASSWORD=postgres `
107-
postgres:16 `
107+
postgres:17 `
108108
sh -c "pg_restore -c -h postgres -U postgres -d thingsboard_mqtt_broker -v /backups/tbmq_backup.dump"
109109
```
110110

@@ -115,7 +115,7 @@ sh -c "pg_restore -c -h postgres -U postgres -d thingsboard_mqtt_broker -v /back
115115
- `-v tbmq-postgres-data:/var/lib/postgresql/data`: Mounts the PostgreSQL data volume.
116116
- `-v $(pwd)/backups:/backups`: Mounts the local `./backups` directory where the backup file is stored.
117117
- `-e PGPASSWORD=postgres`: Supplies the PostgreSQL password.
118-
- `postgres:16`: Uses the PostgreSQL 16 Docker image.
118+
- `postgres:17`: Uses the PostgreSQL 17 Docker image.
119119
- `sh -c 'pg_restore ...'`: The shell command runs `pg_restore` to restore the database from the `tbmq_backup.dump`
120120
file.
121121
- `-c`: Cleans (drops) existing database objects before restoring.

msa/tbmq/configs/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
services:
1818
postgres:
1919
restart: always
20-
image: "postgres:16"
20+
image: "postgres:17"
2121
logging:
2222
driver: "json-file"
2323
options:

0 commit comments

Comments
 (0)