Subject: [PATCH] Fix error on displaying table properties of a table partitioned by list having a default partition.

From: Sander Eikelenboom <[email-masked]>
Date: Mon, 13 May 2019 10:58:55 +0200

L.S.,

This patch fixes an error on displaying table properties of a table partitioned by list having a default partition.
This is an additional fix for bug #3938 which was missed in commit a9d964b5ca04bbe00bf5585d5c19bdfdf603c8a9.

--
Sander Eikelenboom
commit 3d1a09a1b6bc0651801c91dae071bf8a19d61558
Author: Sander Eikelenboom <[email-masked]>
Date:   Mon May 13 10:51:10 2019 +0200

    Fix error on displaying table properties of a table partitioned by list having a default partition.
    This is an additional fix for bug #3938 which was missed in commit a9d964b5ca04bbe00bf5585d5c19bdfdf603c8a9.

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 7815b325..dffec879 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(

---

From: Akshay Joshi <[email-masked]>
Date: Wed, 15 May 2019 18:36:55 +0530

Thanks patch applied.

On Mon, May 13, 2019 at 2:26 PM Sander Eikelenboom <[email-masked]>
wrote:

> L.S.,
>
> This patch fixes an error on displaying table properties of a table
> partitioned by list having a default partition.
> This is an additional fix for bug #3938 which was missed in commit
> a9d964b5ca04bbe00bf5585d5c19bdfdf603c8a9.
>
> --
> Sander Eikelenboom
>

-- 
*Thanks & Regards*
*Akshay Joshi*

*Sr. Software Architect*
*EnterpriseDB Software India Private Limited*
*Mobile: +91 976-788-8246*