diff --git a/templates/backup.yaml.j2 b/templates/backup.yaml.j2
index 60f43b790b7aef2deccfa19e19aae08057444c3e..ae2d39566dca1ce9b01231ee012a2684fbb62667 100644
--- a/templates/backup.yaml.j2
+++ b/templates/backup.yaml.j2
@@ -4,6 +4,7 @@ services:
         image: ghcr.io/tecnativa/docker-duplicity-postgres:master
         hostname: {{ inventory_hostname_short | lower | regex_replace('_','') }}-{{ template_odoo_instance.key }}
         environment:
+            DB_VERSION: "{{ [template_odoo_instance_setup.postgres_version | split('.') | first | int, 10] | max }}"
             DST: "swift://{{ template_odoo_instance.key }}_{{ inventory_hostname | lower }}"
             PGDATABASE: "{{ template_odoo_instance.value.db }}"
             PGUSER: "{{ template_odoo_instance.value.db_user }}"