Subject: RM1492 [pgadmin4]

From: Harshal Dhumal <[email-masked]>
Date: Thu, 4 Aug 2016 15:22:01 +0530

Hi,

PFA patch for RM1492

Issue fixed: Generate proper queries for "View all/first 100/last 100 rows"
with table containing columns with capital letters.

-- 
*Harshal Dhumal*
*Software Engineer*

EnterpriseDB India: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
diff --git a/web/pgadmin/tools/sqleditor/command.py b/web/pgadmin/tools/sqleditor/command.py
index e491fba..de3a9f8 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 != '':

-- 
Sent via pgadmin-hackers mailing list ([email-masked])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers

---

From: Dave Page <[email-masked]>
Date: Thu, 4 Aug 2016 11:55:19 +0100

Thanks, applied.

On Thu, Aug 4, 2016 at 10:52 AM, Harshal Dhumal
<[email-masked]> wrote:
> Harshal Dhumal
> Software Engineer

-- 
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company