diff --git a/redash/query_runner/pg.py b/redash/query_runner/pg.py index 048f5880f0..5524375de6 100644 --- a/redash/query_runner/pg.py +++ b/redash/query_runner/pg.py @@ -152,7 +152,15 @@ def _get_tables(self, schema): ON a.attrelid = c.oid AND a.attnum > 0 AND NOT a.attisdropped - WHERE c.relkind IN ('r', 'v', 'm', 'f', 'p') + WHERE c.relkind IN ('m', 'f', 'p') + + UNION + + SELECT table_schema, + table_name, + column_name + FROM information_schema.columns + WHERE table_schema NOT IN ('pg_catalog', 'information_schema') """ self._get_definitions(schema, query)