def rename_column(table_name, old_column_name, new_column_name, conn,
    schema=None):
    """Renames a column of a table.

    Parameters
    ----------
    table_name : str
        table name
    old_column_name : str
        old column name
    new_column_name : str
        new column name
    conn : sqlalchemy.engine.base.Engine
        an sqlalchemy connection engine created by function `create_engine()`
    schema : str or None
        schema name
    """
    old_column_name = old_column_name.replace('%', '%%')
    if schema is None:
        query_str = 'ALTER TABLE "{}" RENAME COLUMN "{}" TO "{}";'.format(
            table_name, old_column_name, new_column_name)
    else:
        query_str = 'ALTER TABLE "{}"."{}" RENAME COLUMN "{}" TO "{}";'.format(
            schema, table_name, old_column_name, new_column_name)
    conn.execute(query_str)
