From the manual
CREATE MATERIALIZED VIEW is similar to CREATE TABLE AS, except that it also remembers the query used to initialize the view so that it can be updated later on demand.
As I understand it, updating a materialized view should have the same effect as re create view as . But that is not what is happening here.
Create a single column table
drop table if exists t cascade; create table t (a int); insert into t (a) values (1);
Create a Materialized View
create materialized view mat_view_t as select * from t ; select * from mat_view_t; a
Now the column is added to the source table.
alter table t add column b int; \dt Table "public.t" Column | Type | Modifiers
And then the materialized view is updated
refresh materialized view mat_view_t; select * from mat_view_t; a
Where is the new column located? Is this expected behavior? If so, I think the manual is misleading.
source share