Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uN4qi-00BEv4-BE for pgsql-hackers@arkaria.postgresql.org; Thu, 05 Jun 2025 07:17:16 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1uN4qg-004xp5-C3 for pgsql-hackers@arkaria.postgresql.org; Thu, 05 Jun 2025 07:17:15 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uN4qg-004xox-2u for pgsql-hackers@lists.postgresql.org; Thu, 05 Jun 2025 07:17:14 +0000 Received: from mail-vk1-xa30.google.com ([2607:f8b0:4864:20::a30]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uN4qf-000JiU-03 for pgsql-hackers@lists.postgresql.org; Thu, 05 Jun 2025 07:17:14 +0000 Received: by mail-vk1-xa30.google.com with SMTP id 71dfb90a1353d-530756db3d0so274562e0c.2 for ; Thu, 05 Jun 2025 00:17:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1749107831; x=1749712631; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=4jGZzqDdQdOPw0J4u9kfwf6j1HVatOtozhlNo3xhxek=; b=Ehn8i/X8V9iS8A0z5gdCSvQ13v3pqHcT/eatzGoQrnq4iixsFVfOBsGoF2KZr6e0Lf SwQr2kNj8K0jhc+E6gaArDvt28Sr/J6O69viNEMJXeejvTxIC2/FNHnKNghpWfls1o2H einOz4VjTgCOXUUaybGld8vTN/0zFXwevv5k66J0ljpBicLr141f+xtmM9mdw/mSN8VT YQSTH7cu4yugfMPmNt+V7+fX9jpdPv/ZXkik7ObZzOe08k96HX4d08jOdnUVW2fVDmFi fgniCbrlrJRJdUyf73gyUvxmepH/wizK1ceis+7dfUc59tRkwCLfrqdHcEdcet6AtBV2 GFKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749107831; x=1749712631; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=4jGZzqDdQdOPw0J4u9kfwf6j1HVatOtozhlNo3xhxek=; b=swQp6Wr/xvCqrLi+uQlgZhVQm70U+rdBI33yq9mzXnGkgFlgrh2u86oD2/cVGO6Bmy 6Oapu3R55uNf7tHodrQXbjWJlGb6+0NHDWiUAw4KhV+oZZQvf/O7FNOdyHv4G+FmUBB0 inFK0tWuGCEdGDeFQUBeCCEnp/JVzi7N3fwycdXtnDswcnQ1alXkCOMEO11U9YN8hY5u swJUOspRzVjxn4J3EqWTj1BZWy5LktEVB4ZDxI4bu1njM6d7A7bTmkjT07nv3RhRA8w/ I7jCKYMUXaOD9EPGfmBahTRFoG0W/XdODORBZi/2Ld/QBh+qBbBrZzsuwh/scaT++MW9 Z+/w== X-Gm-Message-State: AOJu0Yzms2ViFTNjFdQjQKBwZUh5Mcn6uPUqK2e3uRIFfx6uVC3wZ78b cBaxhslAnYRO2D0EQScxJgZGpNjUerL2qH/4Jjhz0JicqpIOptTwU1/2Fi9tHXTyN/o9KmAOaWE YOBWvI2IR7pju75QBCXrO8pRI0wmKzWZOrn9qtgQbVA== X-Gm-Gg: ASbGncvN9xOVo82Re2dijdf46ieirXvzAVBoPJaPGq9canG5o+ohd6sduzCUp1QKO50 1/fCCOa91Dpkb+GE14nwmCvx418QxNev89ziUAPO8VY05gdmhuBzAPOSZKWRBaLv9cSGDuWLIX9 x4s2hHS8DZ78ZaEmkC2tX6VENq8ZdvDKxJOoc2JMhwD0wKpKndGoQ+jWICwywmMWcb X-Google-Smtp-Source: AGHT+IFc0wA45uGhu6fyiZXBqC2QfPuX6BQjCQFLPaksPM1CrZRTaRxjZaGVqjaoONa3JfweoSEeyg8YOM92cTPVxHo= X-Received: by 2002:a05:6122:2a05:b0:516:18cd:c1fc with SMTP id 71dfb90a1353d-530c73f27d7mr5053586e0c.8.1749107830691; Thu, 05 Jun 2025 00:17:10 -0700 (PDT) MIME-Version: 1.0 References: <171085360143.2046436.7217841141682511557.pgcf@coridan.postgresql.org> <859476bf-3cb0-455e-b093-b8ab5ef17f0e@postgrespro.ru> <4e2764f7-f6be-478f-8d7f-f921dbd10f5f@postgrespro.ru> <7fdaf3e8-4c05-4739-bee6-98acc068d1c7@postgrespro.ru> <4433b492-9e97-4334-96d9-ddaaa5083099@postgrespro.ru> <67ecf5fb-e63d-4284-be75-d0479eef81aa@postgrespro.ru> In-Reply-To: From: jian he Date: Thu, 5 Jun 2025 15:16:34 +0800 X-Gm-Features: AX0GCFtcCylRXPdtZzpCMHg6_IVPYBO9shgGy4h9DWKIZPYOaXSpyTkrj1b0s1M Message-ID: Subject: Re: Add SPLIT PARTITION/MERGE PARTITIONS commands To: Dmitry Koval Cc: pgsql-hackers@lists.postgresql.org, Alexander Korotkov Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk hi. bug in transformPartitionCmdForMerge "equal(name, name2))" +static void +transformPartitionCmdForMerge(CreateStmtContext *cxt, PartitionCmd *partcmd) +{ + + + foreach(listptr, partcmd->partlist) + { + RangeVar *name = (RangeVar *) lfirst(listptr); + + /* Partitions in the list should have different names. */ + for_each_cell(listptr2, partcmd->partlist, lnext(partcmd->partlist, listptr)) + { + RangeVar *name2 = (RangeVar *) lfirst(listptr2); + + if (equal(name, name2)) + ereport(ERROR, + errcode(ERRCODE_DUPLICATE_TABLE), + errmsg("partition with name \"%s\" is already used", name->relname), + parser_errposition(cxt->pstate, name2->location)); + } ALTER TABLE sales_range MERGE PARTITIONS (sales_feb2022, public.sales_feb2022) INTO sales_feb_mar2022; ERROR: lower bound of partition "sales_feb2022" conflicts with upper bound of previous partition "sales_feb2022" in this context. "sales_feb2022" is the same as "public.sales_feb2022".