Share
Views Missing New and Updated Data
Applies To Pipelines configured with Amazon Redshift Destinations.
Error Message Text(s) - Hevo was unable to change some columns in your Destination tables because Redshift does not allow changes to columns that have dependent views. As a result, views in your Destination are showing null values in these columns for new rows. To keep loading data, Hevo renamed each old column to __hevo__<column>__deprecated_<id> and added a new column with the original name and the changed data type or NOT NULL constraint. The new columns contain all your existing data and receive all new data. The views still read the old columns, which do not receive new data. To fix this, create the views again so that they read the new columns, and then delete the old columns. Read the linked troubleshooting article for the steps.

- Hevo was unable to replace some tables in your Destination because Redshift does not allow deleting tables that have dependent views. Hevo needed to replace these tables because the data type or NOT NULL constraint of their distribution key column changed, and Redshift cannot apply this change to an existing table. As a result, views in your Destination are not showing new data from these tables. To keep loading data, Hevo renamed each old table to __hevo__<table>__deprecated_<id> and created a new table with the original name and the changed column. The new tables contain all your existing data and receive all new data. The views still read the old tables, which do not receive new data. To fix this, create the views again so that they read the new tables, and then delete the old tables. Read the linked troubleshooting article for the steps.

- Hevo was unable to replace some tables in your Destination with the complete data from the latest sync because Redshift does not allow deleting tables that have dependent views. As a result, views in your Destination are showing outdated data from these tables. To keep loading data, Hevo renamed each old table to __hevo__<table>__deprecated_<id> and loaded the complete data into a new table with the original name. Hevo loads the complete data of these tables in every sync, so the tables with the original names always contain the latest data. The views still read the old tables, which do not receive new data. To fix this, create the views again so that they read the new tables, and then delete the old tables. Read the linked troubleshooting article for the steps.

Error Summary

Hevo was unable to change some columns or replace some tables in your Destination because Redshift does not allow these changes when the columns or tables have dependent views. As a result, your views are missing new and updated data. To keep loading data, Hevo renamed the old columns or tables and created new ones with the original names. The new columns and tables receive all the data, but your views still read the old ones, which do not receive new data. Read Potential Causes to identify which change affected your Destination, and then perform the steps in Suggested Action(s).

Potential Causes

In Redshift, a regular view depends on the columns and tables it reads. Redshift does not allow Hevo to change or delete a column or table that a regular view reads. However, Hevo needs to change a column or replace a table in the following cases:

  • The data type or NOT NULL constraint of a column changes, and views in your Destination read this column. For example:

    • The maximum length of a text column in your Source increases.

    • A column changes from INT to BIGINT.

    • A column becomes part of the primary key.

    Redshift does not allow Hevo to change this column in your Destination table, so Hevo renames the old column to __hevo__<column>__deprecated_<id> and adds a new column with the original name and the changed data type or NOT NULL constraint. The new column contains all your existing data and receives all new data. Your views still read the renamed column, so rows loaded after the change show null values in this column.

  • The data type or NOT NULL constraint of the distribution key column of a table changes, and views in your Destination read this table. Hevo uses the first primary key column of a table as its distribution key, which decides how Redshift distributes the data for query processing. Redshift cannot apply this change to an existing table, so Hevo must replace the table with a new one. As the old table has dependent views, Hevo renames it to __hevo__<table>__deprecated_<id> instead of deleting it, and creates a new table with the original name and the changed column. The new table contains all your existing data and receives all new data. Your views still read the renamed table, so rows loaded after the change do not appear in them.

  • Hevo replaces a table with a new one that contains its complete data, and views in your Destination read this table. As the old table has dependent views, Hevo renames it to __hevo__<table>__deprecated_<id> instead of deleting it, and gives the original name to the new table. The table with the original name always contains the latest data. Your views still read the renamed table, so they show outdated data. A regular view that you create again on this table also depends on it, so it shows outdated data after the next sync.

A materialized view stores the results of its query, and Redshift updates these results only when the view is refreshed. After Hevo renames a column or table that a materialized view reads, it can no longer be refreshed. You can still query it, but it shows only the data from its last refresh.

Suggested Action(s)

To fix the views that read a renamed column or table, create each of these views again so that it reads the column or table with the original name, and then delete the renamed columns and tables. To do this, perform the following steps:

Note: Replace the placeholder values in the commands below with your own.

  1. Connect to your Redshift database as a superuser, using any SQL client, and run the following queries to find the renamed columns and tables, and the views that read them:

    • To find the renamed columns:

      SELECT table_schema, table_name, column_name FROM information_schema.columns
      WHERE column_name ~ '^__hevo__.*__deprecated_';
      
    • To find the renamed tables:

      SELECT table_schema, table_name FROM information_schema.tables
      WHERE table_name ~ '^__hevo__.*__deprecated_';
      
    • To find the views that read a renamed column or table:

      SELECT dependent_ns.nspname AS dependent_schema, dependent_view.relname AS dependent_view,
             source_ns.nspname AS source_schema, source_table.relname AS source_table,
             pg_attribute.attname AS column_name
      FROM pg_depend
      JOIN pg_rewrite ON pg_depend.objid = pg_rewrite.oid
      JOIN pg_class AS dependent_view ON pg_rewrite.ev_class = dependent_view.oid
      JOIN pg_class AS source_table ON pg_depend.refobjid = source_table.oid
      JOIN pg_attribute ON pg_depend.refobjid = pg_attribute.attrelid
           AND pg_depend.refobjsubid = pg_attribute.attnum
      JOIN pg_namespace dependent_ns ON dependent_ns.oid = dependent_view.relnamespace
      JOIN pg_namespace source_ns ON source_ns.oid = source_table.relnamespace
      WHERE source_ns.nspname = '<schema_name>'
        AND source_table.relname = '<table_name>'
        AND pg_attribute.attnum > 0
      ORDER BY 1, 2;
      

      Note: Replace <table_name> with the renamed table, or with the table that contains the renamed column.

    These queries list every renamed column and table in the database, including those renamed for other Pipelines or in earlier syncs.

  2. Delete each view that reads a renamed column or table, and create it again as a late-binding view. Such a view does not depend on the columns and tables it reads, so it always reads the latest data and does not block future changes. To do this, run the following commands:

    1. Save the definition of the view, so that you can recreate it with the same query:

      SELECT pg_get_viewdef('<schema_name>.<view_name>', true);
      
    2. Delete the view:

      DROP VIEW <schema_name>.<view_name>;
      
    3. Recreate the view using the saved definition:

      CREATE VIEW <schema_name>.<view_name> AS
      SELECT <column_names> FROM <schema_name>.<table_name>
      WITH NO SCHEMA BINDING;
      

    Note: Deleting a view also removes the privileges granted on it, so grant them again after you recreate the view. If other views read this view, Redshift does not allow you to delete it. Delete those views first, and recreate them after this view.

  3. Delete each materialized view that reads a renamed column or table, and create it again. To do this, run the following commands:

    1. Delete the materialized view:

      DROP MATERIALIZED VIEW <schema_name>.<view_name>;
      
    2. Recreate the materialized view:

      CREATE MATERIALIZED VIEW <schema_name>.<view_name> AS
      SELECT <column_names> FROM <schema_name>.<table_name>;
      

    Note: Materialized views cannot be late-binding. A materialized view that you recreate depends on the columns and tables it reads. The next time Hevo changes such a column or replaces such a table, the materialized view can no longer be refreshed. For a table that Hevo replaces with a new one that contains its complete data, this happens after every sync. To avoid this, create a view as described in step 2 instead of a materialized view.

  4. The renamed columns and tables contain only older copies of data that is already available in the columns and tables with the original names. Run the following commands to delete them:

    • To delete a renamed column:

      ALTER TABLE <schema_name>.<table_name> DROP COLUMN "<renamed_column_name>";
      
    • To delete a renamed table:

      DROP TABLE <schema_name>."<renamed_table_name>";
      

    Note: Redshift does not allow you to delete a renamed column or table while a regular view depends on it.


Revision History

Refer to the following table for the list of key updates made to this page:

Date Release Description of Change
Nov-23-2026 NA New document.
Last updated on Nov 23, 2026

Tell us what went wrong

Skip to the section