Fix View Data options for tables with columns that need quoting. Fixes #1492

This commit is contained in:
Harshal Dhumal 2016-08-04 11:54:36 +01:00 committed by Dave Page
parent 8c433fbfce
commit cb35c46f03

View File

@ -365,8 +365,8 @@ class TableCommand(GridCommand):
"""
This function is used to fetch the primary key columns.
"""
manager = get_driver(PG_DEFAULT_DRIVER).connection_manager(self.sid)
driver = get_driver(PG_DEFAULT_DRIVER)
manager = driver.connection_manager(self.sid)
conn = manager.connection(did=self.did, conn_id=self.conn_id)
pk_names = ''
@ -382,7 +382,7 @@ class TableCommand(GridCommand):
raise Exception(result)
for row in result['rows']:
pk_names += row['attname'] + ','
pk_names += driver.qtIdent(conn, row['attname']) + ','
primary_keys[row['attname']] = row['typname']
if pk_names != '':