def format_pg_version(version: int) -> str:
    """Format Postgres version for human consumption.

    :param version: Postgres version represented as an integer.

    :returns: Postgres version represented as a human-readable string.

    :Example:

        >>> format_pg_version(90624)
        '9.6.24'

        >>> format_pg_version(100000)
        '10.0'

        >>> format_pg_version(140008)
        '14.8'
    """
    if version < 100000:
        return "{0}.{1}.{2}".format(version // 10000, version // 100 % 100, version % 100)
    else:
        return "{0}.{1}".format(version // 10000, version % 100)
Format Postgres version for human consumption.

    :param version: Postgres version represented as an integer.

    :returns: Postgres version represented as a human-readable string.

    :Example:

        >>> format_pg_version(90624)
        '9.6.24'

        >>> format_pg_version(100000)
        '10.0'

        >>> format_pg_version(140008)
        '14.8'
    
patroni/ctl.py