public inbox for [email protected]  
help / color / mirror / Atom feed
 [pgAdmin][Patch] Bug #6003 - exibição errada de tabela em trigger de view (Wrong table display in view trigger)
2+ messages / 2 participants
[nested] [flat]

*  [pgAdmin][Patch] Bug #6003 - exibição errada de tabela em trigger de view (Wrong table display in view trigger)
@ 2020-12-01 15:42  Yogesh Mahajan <[email protected]>
  0 siblings, 1 reply; 2+ messages in thread

From: Yogesh Mahajan @ 2020-12-01 15:42 UTC (permalink / raw)
  To: pgadmin-hackers

Hi,

Please find a patch which fixes incorrect view trigger sql display for
table sql.

Thanks,
Yogesh Mahajan
EnterpriseDB


Attachments:

  [application/octet-stream] RM6003_v1.patch (1.2K, 3-RM6003_v1.patch)
  download | inline diff:
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/__init__.py
index ca1290128..f946e306e 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/__init__.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/__init__.py
@@ -1255,10 +1255,13 @@ class ViewNode(PGChildNodeView, VacuumSettings, SchemaDiffObjectCompare):
                 res_rows['tfunction'] = result['rows'][0]['tfunctions']
 
             # Format arguments
-            if len(res_rows['custom_tgargs']) > 1:
-                formatted_args = ["{0}".format(arg) for arg in
-                                  res_rows['custom_tgargs']]
+            if len(res_rows['custom_tgargs']) > 0:
+                driver = get_driver(PG_DEFAULT_DRIVER)
+                formatted_args = [driver.qtLiteral(arg)
+                                  for arg in res_rows['custom_tgargs']]
                 res_rows['tgargs'] = ', '.join(formatted_args)
+            else:
+                res_rows['tgargs'] = None
 
             SQL = render_template("/".join(
                 [self.trigger_temp_path,


^ permalink  raw  reply  [nested|flat] 2+ messages in thread

*  Re: [pgAdmin][Patch] Bug #6003 - exibição errada de tabela em trigger de view (Wrong table display in view trigger)
@ 2020-12-03 05:17  Akshay Joshi <[email protected]>
  parent: Yogesh Mahajan <[email protected]>
  0 siblings, 0 replies; 2+ messages in thread

From: Akshay Joshi @ 2020-12-03 05:17 UTC (permalink / raw)
  To: Yogesh Mahajan <[email protected]>; +Cc: pgadmin-hackers

Thanks, patch applied.

On Tue, Dec 1, 2020 at 9:13 PM Yogesh Mahajan <
[email protected]> wrote:

> Hi,
>
> Please find a patch which fixes incorrect view trigger sql display for
> table sql.
>
> Thanks,
> Yogesh Mahajan
> EnterpriseDB
>


-- 
*Thanks & Regards*
*Akshay Joshi*
*pgAdmin Hacker | Principal Software Architect*
*EDB Postgres <http://edbpostgres.com>*

*Mobile: +91 976-788-8246*


^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2020-12-03 05:17 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-12-01 15:42  [pgAdmin][Patch] Bug #6003 - exibição errada de tabela em trigger de view (Wrong table display in view trigger) Yogesh Mahajan <[email protected]>
2020-12-03 05:17 ` Akshay Joshi <[email protected]>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox