Is it possible to drop a RedShift auto materialized view?

All we need is an easy explanation of the problem, so here it is.

I’m trying to alter a table definition, but it’s dependent on a materialized view which is managed by RedShift Auto Materialization and not by us. So attempting

ALTER TABLE my_table
    ALTER COLUMN my_column TYPE VARCHAR(100);

Errors with

[0A000] ERROR: cannot alter type of a column used by a materialized view

So I attempt to drop the materialized view

DROP MATERIALIZED VIEW pg_automv.auto_mv_53022635;

Which gives a permission error

[42501] ERROR: permission denied for schema pg_automv

How to solve :

I know you bored from this bug, So we are here to help you! Take a deep breath and look at the explanation of your problem. We have many solutions to this problem, But we recommend you to use the first method because it is tested & true method that will 100% work for you.

Method 1

It’s not possible, they are fully managed by AWS. The solution from AWS support is to turn off AutoMV and reboot to drop all AutoMV.

That is harsh.

Note: Use and implement method 1 because this method fully tested our system.
Thank you 🙂

All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply