From cb35c46f03222693e145f35a97a1dca63f7f9ed5 Mon Sep 17 00:00:00 2001 From: Harshal Dhumal Date: Thu, 4 Aug 2016 11:54:36 +0100 Subject: [PATCH] Fix View Data options for tables with columns that need quoting. Fixes #1492 --- web/pgadmin/tools/sqleditor/command.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/web/pgadmin/tools/sqleditor/command.py b/web/pgadmin/tools/sqleditor/command.py index e491fba94..de3a9f871 100644 --- a/web/pgadmin/tools/sqleditor/command.py +++ b/web/pgadmin/tools/sqleditor/command.py @@ -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 != '':