4 Replies Latest reply on Jun 29, 2015 3:58 PM by Angie Moe

    Using materialized views in Postgres




      I guess I count as the DBA for the data warehouse that our company uses with Tableau Desktop. We use Postgres for this data store and recently upgraded to version 9.3 in order to take advantage of materialized views to speed up some of our queries. The problem is that normal views appear in the list of tables in Tableau, however, materialized views do not.


      It does not seem to be a permissions issue as the database user can select from the materialized view in a psql console and also the data can be retrieved in Tableau using custom SQL (e.g. SELECT * FROM v_my_materialized_view lists the contents of the materialized view in Tableau without problem).


      Some googling leads me to suspect that this is related to how Postgres is only listing standard views and not materialized views in information schema, e.g. postgresql - how to introspect materialized views - Stack Overflow. My current workaround suggestion has been to wrap the materialized views inside an ordinary view (e.g. CREATE VIEW vv_my_view AS SELECT * FROM v_my_materialized_view; -- vv_my_view appears in the list of tables even if v_my_materialized_views does not).


      I have not been able to find any similar comments online about using Postres materialized views with Tableau. Has anyone else had come across and solved this problem? Or is it an issue with Postgres rather than Tableau Desktop?