def METHOD_NAME():
    from indico.core.db import db
    version = db.engine.execute("SELECT current_setting('server_version_num')::int").scalar()
    major = version // 10000
    minor = version % 10000 // 100
    patch = version % 100
    if major >= 10:
        # https://www.postgresql-archive.org/PG-VERSION-NUM-formatted-incorrectly-td6002110.html
        return f'{major}.{patch}'
    else:
        return f'{major}.{minor}.{patch}'