Updating postgres when using docker-compose

This might be outside the scope of django forums, but maybe someone can help me.
I am running django inside docker using docker-compose. My docker-compose.yml looks like:

version: '3.8'

services:
  web:
    build: .
    command: python /code/manage.py runserver 0.0.0.0:8000
    volumes:
      - .:/code
    ports:
      - 8000:8000

    stdin_open: true
    tty: true
    depends_on:
      - db
    environment:
      - "DJANGO_SECRET_KEY=""
      - "DJANGO_DEBUG=True"
      - "ALLOWED_HOSTS=170.031.435.34,.smartmark.ca,localhost,127.0.0.1"

  db:
    image: postgres:11
    volumes:
      - postgres_data:/var/lib/postgresql/data/
    environment:
      - "POSTGRES_HOST_AUTH_METHOD=trust"

I am interested in updating to Django 4.2 which no longer supports postgres 11. If I want to update to postgres 13, is it as simple as replacing image in my docker-compose file to image: postgres:13?

thanks

It should be - or even PostgreSQL 14.

You may need to run the upgrade process if that data volume is persistent, but I’ve never had a problem with it.

Moving to PostgreSQL 15 as a container may create a permissions / schema issue needing to be addressed, but is also possible.