def METHOD_NAME(name: str) -> bytes:
    """Convert a Python encoding name to PostgreSQL encoding name.
    Raise LookupError if the Python encoding is unknown.
    """
    return pg_codecs[codecs.lookup(name).name]