Richard
Richard

Reputation: 65560

Postgres: Is it OK to create a materialized view based on another materialized view?

I'm working in Postgres 9.4. Is it OK to create a materialized view based on another materialized view?

It doesn't seem to produce any errors:

# create materialized view vw_county as select * from domes_county;
SELECT 40
# create materialized view vw_county_meta as select * from vw_county;
SELECT 40

I guess when I update the database, I need to be careful to update the materialized views in the correct order.

But is there anyother reason why it might be dangerous?

Upvotes: 0

Views: 303

Answers (1)

ARGStackOvaFlo
ARGStackOvaFlo

Reputation: 305

Yes you can create a MV using another MV. But the main problem lies when u try to refresh the newly created MV. You may face issues while refresh using fast method.

Upvotes: 0

Related Questions