Skip to content

Commit

Permalink
add column type info to postgres query_runner
Browse files Browse the repository at this point in the history
  • Loading branch information
alison985 committed Jul 28, 2017
1 parent 7e8c1c7 commit e39fc2e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions redash/query_runner/pg.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,11 @@ def _get_definitions(self, schema, query):
if table_name not in schema:
schema[table_name] = {'name': table_name, 'columns': []}

schema[table_name]['columns'].append(row['column_name'])
schema[table_name]['columns'].append(row['column_name'] + ' (' + row['column_type'] + ')')

def _get_tables(self, schema):
query = """
SELECT table_schema, table_name, column_name
SELECT table_schema, table_name, column_name, udt_name as column_type
FROM information_schema.columns
WHERE table_schema NOT IN ('pg_catalog', 'information_schema');
"""
Expand Down

0 comments on commit e39fc2e

Please sign in to comment.