public inbox for [email protected]  
help / color / mirror / Atom feed
[pgAdmin4][Patch]: RM 3702 - pgAdmin dashboard showing the oid for the user-defined tables and table names for the catalog tables in locks monitoring window
2+ messages / 2 participants
[nested] [flat]

* [pgAdmin4][Patch]: RM 3702 - pgAdmin dashboard showing the oid for the user-defined tables and table names for the catalog tables in locks monitoring window
@ 2019-01-04 09:18 Khushboo Vashi <[email protected]>
  2019-01-04 14:45 ` Re: [pgAdmin4][Patch]: RM 3702 - pgAdmin dashboard showing the oid for the user-defined tables and table names for the catalog tables in locks monitoring window Dave Page <[email protected]>
  0 siblings, 1 reply; 2+ messages in thread

From: Khushboo Vashi @ 2019-01-04 09:18 UTC (permalink / raw)
  To: pgadmin-hackers

Hi,

Please find the attached patch to fix RM #3702 - pgAdmin dashboard showing
the oid for the user-defined tables and table names for the catalog tables
in locks monitoring window.

Dashboard > Server Activity > Locks - shows the table oid in the 'Target
relation' column instead of table name.

The attached patch fixes this issue for the database level but not for the
server level.  The reason for this is, at the server level we fetch the
data from the pg_locks with the maintenance database, so it can not fetch
the pg_class relation for the other database tables (relation::regclass).

Please find the attached screen-shots for the issue and the fix and let me
know if there is any other way to fix this.

Thanks,
Khushboo


Attachments:

  [image/png] Table_lock_after.png (1.0M, 3-Table_lock_after.png)
  download | view image

  [image/png] Table_lock_before.png (442.7K, 4-Table_lock_before.png)
  download | view image

  [application/octet-stream] RM_3702.patch (2.3K, 5-RM_3702.patch)
  download | inline diff:
diff --git a/web/pgadmin/dashboard/__init__.py b/web/pgadmin/dashboard/__init__.py
index 5d14fa7d..9a0118c8 100644
--- a/web/pgadmin/dashboard/__init__.py
+++ b/web/pgadmin/dashboard/__init__.py
@@ -219,25 +219,10 @@ def check_precondition(f):
                             " to view the graph.")
                 )
 
-        g.conn = g.manager.connection()
-
-        # If DB not connected then return error to browser
-        if not g.conn.connected():
-            if f.__name__ in stats_type:
-                return precondition_required(
-                    gettext("Please connect to the selected server"
-                            " to view the table.")
-                )
-            else:
-                return precondition_required(
-                    gettext("Please connect to the selected server"
-                            " to view the graph.")
-                )
-
         if 'did' in kwargs:
-            db_conn = g.manager.connection(did=kwargs['did'])
+            g.conn = g.manager.connection(did=kwargs['did'])
             # If the selected DB not connected then return error to browser
-            if not db_conn.connected():
+            if not g.conn.connected():
                 if f.__name__ in stats_type:
                     return precondition_required(
                         gettext("Please connect to the selected database"
@@ -248,6 +233,21 @@ def check_precondition(f):
                         gettext("Please connect to the selected database to"
                                 " view the graph.")
                     )
+        else:
+            g.conn = g.manager.connection()
+
+            # If DB not connected then return error to browser
+            if not g.conn.connected():
+                if f.__name__ in stats_type:
+                    return precondition_required(
+                        gettext("Please connect to the selected server"
+                                " to view the table.")
+                    )
+                else:
+                    return precondition_required(
+                        gettext("Please connect to the selected server"
+                                " to view the graph.")
+                    )
 
         # Set template path for sql scripts
         g.server_type = g.manager.server_type


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

* Re: [pgAdmin4][Patch]: RM 3702 - pgAdmin dashboard showing the oid for the user-defined tables and table names for the catalog tables in locks monitoring window
  2019-01-04 09:18 [pgAdmin4][Patch]: RM 3702 - pgAdmin dashboard showing the oid for the user-defined tables and table names for the catalog tables in locks monitoring window Khushboo Vashi <[email protected]>
@ 2019-01-04 14:45 ` Dave Page <[email protected]>
  0 siblings, 0 replies; 2+ messages in thread

From: Dave Page @ 2019-01-04 14:45 UTC (permalink / raw)
  To: Khushboo Vashi <[email protected]>; +Cc: pgadmin-hackers

Thanks, patch applied.

On Fri, Jan 4, 2019 at 11:53 AM Khushboo Vashi
<[email protected]> wrote:
>
> Hi,
>
> Please find the attached patch to fix RM #3702 - pgAdmin dashboard showing the oid for the user-defined tables and table names for the catalog tables in locks monitoring window.
>
> Dashboard > Server Activity > Locks - shows the table oid in the 'Target relation' column instead of table name.
>
> The attached patch fixes this issue for the database level but not for the server level.  The reason for this is, at the server level we fetch the data from the pg_locks with the maintenance database, so it can not fetch the pg_class relation for the other database tables (relation::regclass).
>
> Please find the attached screen-shots for the issue and the fix and let me know if there is any other way to fix this.
>
> Thanks,
> Khushboo
>
>


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

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





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


end of thread, other threads:[~2019-01-04 14:45 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-01-04 09:18 [pgAdmin4][Patch]: RM 3702 - pgAdmin dashboard showing the oid for the user-defined tables and table names for the catalog tables in locks monitoring window Khushboo Vashi <[email protected]>
2019-01-04 14:45 ` Dave Page <[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