From 9468c80a78b806cedcbe5855bd00cb81af314253 Mon Sep 17 00:00:00 2001 From: Aditya Toshniwal Date: Thu, 14 Jul 2022 18:01:31 +0530 Subject: [PATCH] Fixed an issue where comments on indexes are not displayed. Fixes #7508 --- docs/en_US/release_notes_6_12.rst | 1 + .../schemas/tables/templates/indexes/sql/default/nodes.sql | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/en_US/release_notes_6_12.rst b/docs/en_US/release_notes_6_12.rst index c613e1c1f..3093a7c22 100644 --- a/docs/en_US/release_notes_6_12.rst +++ b/docs/en_US/release_notes_6_12.rst @@ -24,6 +24,7 @@ Bug fixes ********* | `Issue #7471 `_ - Ensure that the splash screen can be moved. + | `Issue #7508 `_ - Fixed an issue where comments on indexes are not displayed. | `Issue #7517 `_ - Enable the start debugging button once execution is completed. | `Issue #7518 `_ - Ensure that dashboard graph API is not called after the panel has been closed. | `Issue #7519 `_ - Ensure that geometry should be shown for all the selected cells. diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/indexes/sql/default/nodes.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/indexes/sql/default/nodes.sql index f699526e6..621d41d1a 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/indexes/sql/default/nodes.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/indexes/sql/default/nodes.sql @@ -1,5 +1,6 @@ SELECT DISTINCT ON(cls.relname) cls.oid, cls.relname as name, -(SELECT (CASE WHEN count(i.inhrelid) > 0 THEN true ELSE false END) FROM pg_inherits i WHERE i.inhrelid = cls.oid) as is_inherited +(SELECT (CASE WHEN count(i.inhrelid) > 0 THEN true ELSE false END) FROM pg_inherits i WHERE i.inhrelid = cls.oid) as is_inherited, +CASE WHEN contype IN ('p', 'u', 'x') THEN desp.description ELSE des.description END AS description FROM pg_catalog.pg_index idx JOIN pg_catalog.pg_class cls ON cls.oid=indexrelid JOIN pg_catalog.pg_class tab ON tab.oid=indrelid @@ -8,6 +9,8 @@ FROM pg_catalog.pg_index idx JOIN pg_catalog.pg_am am ON am.oid=cls.relam LEFT JOIN pg_catalog.pg_depend dep ON (dep.classid = cls.tableoid AND dep.objid = cls.oid AND dep.refobjsubid = '0' AND dep.refclassid=(SELECT oid FROM pg_catalog.pg_class WHERE relname='pg_constraint') AND dep.deptype='i') LEFT OUTER JOIN pg_catalog.pg_constraint con ON (con.tableoid = dep.refclassid AND con.oid = dep.refobjid) + LEFT OUTER JOIN pg_catalog.pg_description des ON (des.objoid=cls.oid AND des.classoid='pg_class'::regclass) + LEFT OUTER JOIN pg_catalog.pg_description desp ON (desp.objoid=con.oid AND desp.objsubid = 0 AND desp.classoid='pg_constraint'::regclass) WHERE indrelid = {{tid}}::OID AND conname is NULL {% if idx %}