From f8e0b54836531d9c5afe494c0d9a8345d5cddb91 Mon Sep 17 00:00:00 2001 From: Aditya Toshniwal Date: Fri, 1 Nov 2019 11:58:38 +0000 Subject: [PATCH] Ensure comments are shown in reverse engineered SQL for table partitions. Fixes #4191 --- docs/en_US/release_notes_4_15.rst | 1 + .../tables/templates/partitions/sql/pg/10_plus/create.sql | 5 +++++ .../tables/templates/partitions/sql/ppas/10_plus/create.sql | 5 +++++ 3 files changed, 11 insertions(+) diff --git a/docs/en_US/release_notes_4_15.rst b/docs/en_US/release_notes_4_15.rst index 3dbaa73d1..80f076743 100644 --- a/docs/en_US/release_notes_4_15.rst +++ b/docs/en_US/release_notes_4_15.rst @@ -23,6 +23,7 @@ Bug fixes | `Issue #3789 `_ - Ensure context menus never get hidden below the menu bar. | `Issue #3913 `_ - Ensure the correct "running at" agent is shown when a pgAgent job is executing. | `Issue #3915 `_ - Fix an issue in the Query Tool where shortcut keys could be ignored following a query error. +| `Issue #4191 `_ - Ensure comments are shown in reverse engineered SQL for table partitions. | `Issue #4341 `_ - Give appropriate error messages when the user tries to use an blank master password. | `Issue #4459 `_ - Don't quote bigints when copying them from the Query Tool results grid. | `Issue #4482 `_ - Ensure compression level is passed to pg_dump when backing up in directory format. diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/partitions/sql/pg/10_plus/create.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/partitions/sql/pg/10_plus/create.sql index a033f9c6e..6db5452b5 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/partitions/sql/pg/10_plus/create.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/partitions/sql/pg/10_plus/create.sql @@ -34,3 +34,8 @@ TABLESPACE {{ conn|qtIdent(data.spcname) }}; ALTER TABLE {{conn|qtIdent(data.schema, data.name)}} OWNER to {{conn|qtIdent(data.relowner)}}; {% endif %} +{### SQL for COMMENT ###} +{% if data.description %} +COMMENT ON TABLE {{conn|qtIdent(data.schema, data.name)}} + IS {{data.description|qtLiteral}}; +{% endif %} diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/partitions/sql/ppas/10_plus/create.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/partitions/sql/ppas/10_plus/create.sql index a033f9c6e..6db5452b5 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/partitions/sql/ppas/10_plus/create.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/partitions/sql/ppas/10_plus/create.sql @@ -34,3 +34,8 @@ TABLESPACE {{ conn|qtIdent(data.spcname) }}; ALTER TABLE {{conn|qtIdent(data.schema, data.name)}} OWNER to {{conn|qtIdent(data.relowner)}}; {% endif %} +{### SQL for COMMENT ###} +{% if data.description %} +COMMENT ON TABLE {{conn|qtIdent(data.schema, data.name)}} + IS {{data.description|qtLiteral}}; +{% endif %}