Skip to content

Allow materialized views as input table to pivot.

Created by: JohnDeGitt

Pivotmytable function uses 'information_schema' as source to get details about tables and columns but this schema doesn't contain information about materialized views. One should use Postgresql specific catalog tables (e.g. pg_attribute) which are source of information on all relations (tables, views, materialized views, etc...). The SQL script can be modified according to Erwin Brandstetter advices as described on http://stackoverflow.com/questions/19127561/how-to-introspect-materialized-views.