PostgreSQL: How to add materialized view as a data table?
Question
I have some materialized views I would like to add as data tables. I can add regular views but materialized views don't seem to show up in the data model. Is there a way to add these?
Answer
Currently, for PostgreSQL, Holistics does list tables and views, but not materialized views.
Behind the scenes, we query the table list from PostgreSQL schema tables which only includes Table & View.
select * from information_schema.tables
Meanwhile, as a workaround, you can create a transform model, and use a simple SQL to query from your materialized view following these steps
- Click Create new Data Model and select Data Transform
- Then in Create Transform Model modal, write the query to select data from your materialized view and Run
SELECT * FROM your_materialized_view_name
Finally, save your Data Model. From now on, you can use that Data Model the same way as Data Model from the Table.