Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hQ6ko-0005KJ-GH for pgadmin-hackers@arkaria.postgresql.org; Mon, 13 May 2019 08:56:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hQ6km-0001Ai-UM for pgadmin-hackers@arkaria.postgresql.org; Mon, 13 May 2019 08:56:12 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hQ6km-0001Ab-HB for pgadmin-hackers@lists.postgresql.org; Mon, 13 May 2019 08:56:12 +0000 Received: from server.eikelenboom.it ([91.121.65.215]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hQ6kj-0008RD-7A for pgadmin-hackers@postgresql.org; Mon, 13 May 2019 08:56:11 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=eikelenboom.it; s=20180706; h=Content-Type:MIME-Version:Date:Message-ID: Subject:From:To:Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=bKzEIEEfSxJSij9wdCqoNjVb6uzxltZfEWmsk8CiGuE=; b=S/6hzD0Ep3zNzFAjw/o1/oluFq N4SvlZLvraDra8sub+DPLmmNcYM4xN7nWRkl35s2PkA5bHbwB2k2MWY+9FWuUus/62xKQdMGwM/V9 Tm40gOpWjR0h3xYLEXTK3ogvEQ6XqWqxJNl5iW/QskXNubBH5Z8jdirAGGSAtRREd38o=; Received: from ip4da85049.direct-adsl.nl ([77.168.80.73]:54630 helo=[10.97.34.6]) by server.eikelenboom.it with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1hQ6kn-0003Lj-5T for pgadmin-hackers@postgresql.org; Mon, 13 May 2019 10:56:13 +0200 To: pgadmin-hackers From: Sander Eikelenboom Subject: [PATCH] Fix error on displaying table properties of a table partitioned by list having a default partition. Message-ID: <8ff576c5-05ce-5514-7aba-94228d2765c8@eikelenboom.it> Date: Mon, 13 May 2019 10:58:55 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------77DC005F399528FE819B2F8F" Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is a multi-part message in MIME format. --------------77DC005F399528FE819B2F8F Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit 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 --------------77DC005F399528FE819B2F8F Content-Type: text/x-patch; name="fix-table-properties-display.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="fix-table-properties-display.diff" commit 3d1a09a1b6bc0651801c91dae071bf8a19d61558 Author: Sander Eikelenboom 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( --------------77DC005F399528FE819B2F8F--