def does_table_exist_sql(name):
    """
    Generate SQL to check if a table exists
    See https://www.dbrnd.com/2017/07/postgresql-different-options-to-check-if-table-exists-in-database-to_regclass/
    :param name: table name
    :return: SQL string
    """
    return f"SELECT EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLES.TABLE_NAME='{name}');"