def table_exists(table_name, curr):
    """Checks whether a table with name 'table_name' exists in the database.

    Parameters
    ----------
    table_name: string
        Name of the postgresql table to be checked.
    curr: database cursor

    Returns
    -------
    result: boolean
        Returns True if the table exists, otherwise False.

    """
    sql = "SELECT relname FROM pg_class WHERE relname = %s;"
    curr.execute(sql, (table_name,))
    if curr.fetchone() is None:
        return False
    else:
        return True