[Amazon](500310) Invalid operation: cannot drop table because other objects depend on it

You might encounter the below error while trying to drop a table from Amazon Redshift database.

Error : [Amazon](500310) Invalid operation: cannot drop table feedback because other objects depend on it

You are not able to drop the table because there are objects depending on it. You can view the objects that are dependent on the table using below sql statement:

select * from information_schema.view_table_usage where table_schema='schemaname' and table_name='tablename';

After reviewing the dependent objects, if you’ve decided to drop the table as well as the dependent objects, use cascade option as shown below. This will drop the table as well as the dependent objects.

drop table <tablename> cascade;

See also  How to vacuum a table in Redshift database