Hi,

PFA minor patch to fix the issue where it was throwing internal server
error on SQL panel when trigger is of update event type.

I have updated sample code to re-produce the issue on RM.
RM#2668


--
Regards,
Murtuza Zabuawala
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

[image: https://community.postgresrocks.net/]
<https://community.postgresrocks.net/>
diff --git 
a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/__init__.py
 
b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/__init__.py
index 19dcf8a..5c06d9d 100644
--- 
a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/__init__.py
+++ 
b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/__init__.py
@@ -949,7 +949,7 @@ class TriggerView(PGChildNodeView):
             # We know that trigger has more than 1 argument, let's join them
             data['tgargs'] = self._format_args(data['custom_tgargs'])
 
-        if len(data['tgattr']) > 1:
+        if len(data['tgattr']) >= 1:
             columns = ', '.join(data['tgattr'].split(' '))
             data['columns'] = self._column_details(tid, columns)
 
diff --git 
a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/utils.py 
b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/utils.py
index 11d40dd..9444b82 100644
--- 
a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/utils.py
+++ 
b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/utils.py
@@ -995,7 +995,7 @@ class BaseTableView(PGChildNodeView):
                 # We know that trigger has more than 1 argument, let's join 
them
                 data['tgargs'] = self._format_args(data['custom_tgargs'])
 
-            if len(data['tgattr']) > 1:
+            if len(data['tgattr']) >= 1:
                 columns = ', '.join(data['tgattr'].split(' '))
 
                 SQL = render_template("/".join([self.trigger_template_path,
@@ -1009,7 +1009,7 @@ class BaseTableView(PGChildNodeView):
                 columns = []
 
                 for col_row in rset['rows']:
-                    columns.append({'column': col_row['name']})
+                    columns.append(col_row['name'])
 
                 data['columns'] = columns
 

Reply via email to