Hi Hackers,
Attached is the patch to fix the Issue with temporary tables on commit drop
as. This patch fixes the issue where an error was thrown when the user
tried to create a temporary table via query tool and no result
was displayed when the query was executed.

Please review.

-- 
*Regards,*
*Amol Vyavahare*
*E**nterpriseDB Corporation*
The Enterprise Postgres Company
*T: +91 20 6644 9600, M: +91 738 738 2128*
[image: EDB Postgres] <http://www.edbpostgres.com/>Unit 301 A, Third Floor,
Godrej Castlemaine,
155, Sassoon Road, Pune, MH - 411001
[image: Blog Feed] <http://blogs.edbpostgres.com/> [image: Facebook]
<https://www.facebook.com/EnterpriseDB> [image: Twitter]
<https://twitter.com/EnterpriseDB> [image: LinkedIn]
<https://www.linkedin.com/company/14958?trk=tyah> [image: Google+]
<https://plus.google.com/108046988421677398468>
Website: www.enterprisedb.com
EnterpriseDB Blog: http://blogs.enterprisedb.com/
Follow us on Twitter: http://www.twitter.com/enterprisedb
diff --git a/web/pgadmin/tools/sqleditor/utils/is_query_resultset_updatable.py b/web/pgadmin/tools/sqleditor/utils/is_query_resultset_updatable.py
index d64cec5..697a4f2 100644
--- a/web/pgadmin/tools/sqleditor/utils/is_query_resultset_updatable.py
+++ b/web/pgadmin/tools/sqleditor/utils/is_query_resultset_updatable.py
@@ -71,7 +71,8 @@ def is_query_resultset_updatable(conn, sql_path):
                                table_oid=table_oid,
                                sql_path=sql_path)
 
-        is_resultset_updatable = has_oids or primary_keys is not None
+        is_resultset_updatable = has_oids or (primary_keys is not None and
+                                              len(primary_keys) != 0)
 
         if is_resultset_updatable:
             column_types = get_columns_types(columns_info=columns_info,
@@ -114,6 +115,8 @@ def _check_editable_columns(table_columns, results_columns):
             results_column['is_editable'] = False
         elif table_column_number in table_columns_numbers:  # Duplicate
             results_column['is_editable'] = False
+        elif table_column_number not in table_columns:
+            results_column['is_editable'] = False
         elif results_column['display_name'] \
                 != table_columns[table_column_number]:
             results_column['is_editable'] = False

Reply via email to