From ab5f35da8d5242a74b42f1da28267ade27bd1b43 Mon Sep 17 00:00:00 2001 From: Sander Eikelenboom Date: Wed, 15 May 2019 18:36:16 +0530 Subject: [PATCH] Fixed error on displaying table properties of a table partitioned by list having a default partition. Fixes #4262 --- docs/en_US/release_notes_4_7.rst | 3 ++- .../servers/databases/schemas/tables/utils.py | 14 ++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/docs/en_US/release_notes_4_7.rst b/docs/en_US/release_notes_4_7.rst index bfe950e60..f764df9ad 100644 --- a/docs/en_US/release_notes_4_7.rst +++ b/docs/en_US/release_notes_4_7.rst @@ -22,4 +22,5 @@ Bug fixes | `Bug #4244 `_ - Fix Tab key issue for Toggle switch controls and button on the dialog footer in Safari browser. | `Bug #4245 `_ - Ensure that element should get highlighted when they get focus on using Tab key. | `Bug #4246 `_ - Fixed console error when subnode control is used in panels. -| `Bug #4261 `_ - Stop using application/x-javascript as a mime type and use the RFC-compliant application/javascript instead. \ No newline at end of file +| `Bug #4261 `_ - Stop using application/x-javascript as a mime type and use the RFC-compliant application/javascript instead. +| `Bug #4262 `_ - Fixed error on displaying table properties of a table partitioned by list having a default partition. \ No newline at end of file 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 05a6a2382..639e252bc 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 @@ -2203,14 +2203,20 @@ class BaseTableView(PGChildNodeView, BasePartitionTable): 'is_default': is_default }) elif data['partition_type'] == 'list': - range_part = \ - row['partition_value'].split('FOR VALUES IN (')[1] + if row['partition_value'] == 'DEFAULT': + is_default = True + range_in = None + else: + range_part = row['partition_value'].split( + 'FOR VALUES IN (')[1] + range_in = range_part[:-1] + is_default = False - range_in = range_part[:-1] partitions.append({ 'oid': row['oid'], 'partition_name': partition_name, - 'values_in': range_in + 'values_in': range_in, + 'is_default': is_default }) else: range_part = row['partition_value'].split(