From 75bc46970837be0942ac0c45c1db6bb674c27890 Mon Sep 17 00:00:00 2001 From: Paul Graff Date: Wed, 6 Mar 2019 00:41:48 -0600 Subject: [PATCH] Remove duplicate column information for late-binding views (#3537) Since the svv_columns system view supports them now https://docs.aws.amazon.com/redshift/latest/dg/r_SVV_COLUMNS.html --- redash/query_runner/pg.py | 9 --------- 1 file changed, 9 deletions(-) diff --git a/redash/query_runner/pg.py b/redash/query_runner/pg.py index aecde7e543..048f5880f0 100644 --- a/redash/query_runner/pg.py +++ b/redash/query_runner/pg.py @@ -261,8 +261,6 @@ def configuration_schema(cls): def _get_tables(self, schema): # Use svv_columns to include internal & external (Spectrum) tables and views data for Redshift # https://docs.aws.amazon.com/redshift/latest/dg/r_SVV_COLUMNS.html - # Use PG_GET_LATE_BINDING_VIEW_COLS to include schema for late binding views data for Redshift - # https://docs.aws.amazon.com/redshift/latest/dg/PG_GET_LATE_BINDING_VIEW_COLS.html # Use HAS_SCHEMA_PRIVILEGE(), SVV_EXTERNAL_SCHEMAS and HAS_TABLE_PRIVILEGE() to filter # out tables the current user cannot access. # https://docs.aws.amazon.com/redshift/latest/dg/r_HAS_SCHEMA_PRIVILEGE.html @@ -276,13 +274,6 @@ def _get_tables(self, schema): ordinal_position AS pos FROM svv_columns WHERE table_schema NOT IN ('pg_internal','pg_catalog','information_schema') - UNION ALL - SELECT DISTINCT view_name::varchar AS table_name, - view_schema::varchar AS table_schema, - col_name::varchar AS column_name, - col_num AS pos - FROM pg_get_late_binding_view_cols() - cols(view_schema name, view_name name, col_name name, col_type varchar, col_num int) ) SELECT table_name, table_schema, column_name FROM tables