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.96) (envelope-from ) id 1vWv7D-00CoE7-1Q for pgsql-hackers@arkaria.postgresql.org; Sat, 20 Dec 2025 11:27:16 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vWv7B-00AJGI-2h for pgsql-hackers@arkaria.postgresql.org; Sat, 20 Dec 2025 11:27:14 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vWv7B-00AJG9-1g for pgsql-hackers@lists.postgresql.org; Sat, 20 Dec 2025 11:27:14 +0000 Received: from mail-oa1-x33.google.com ([2001:4860:4864:20::33]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vWv7A-001eqq-2A for pgsql-hackers@lists.postgresql.org; Sat, 20 Dec 2025 11:27:13 +0000 Received: by mail-oa1-x33.google.com with SMTP id 586e51a60fabf-3eae4e590a4so1252219fac.1 for ; Sat, 20 Dec 2025 03:27:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1766230031; x=1766834831; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=ayqZ2twrpCAjRoMLZWCSqaXLYs4ZXo/b9WJ+XLLR3OE=; b=Pi48RtZbwEReGB3JrW6mfePBw5NCWBc/7n59ztYwMS3VzgdcIqo1pC+7/MN+teBY0Q are0ORLc1+hBROoB4GtJTPKr5zLCGXbmDC30O+hPoKYsEwFmn/pVz6iE4ZFUZJDPRViX qA4iroa+9MczQ9n4dAN5v50tZGHnut17XuuenzG3Bn5VJW3pZ4josdEsuIab0zoSWY/7 iEIsBf6OBEBiiqmeRrfUUPL3i4YxDkz+s6nPoLrbIb2W9SUxc2YXaqZO4m7/zB4sxfCP gfTQjjoyM8KFlnxvTfzKSet5a0pxJm8UXbmpqWCy2toaBZ/fSk8hPdKlR2pIli80ASHB RD2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1766230031; x=1766834831; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=ayqZ2twrpCAjRoMLZWCSqaXLYs4ZXo/b9WJ+XLLR3OE=; b=xILaZtmIoQ3jMC8os32QLAaRjp7NfgcwvgvSYdWf9ZOmBuqy9Uhi1PpYgYtpETWq7Y 1zwi6P6HBFfZMDVQIHvWhzm6mhlX+a5c6lpq3xH987u2R8yOATm2T3WzPWcYkygnNV3K Lf/NzxULl9A7cQWOTT6s+7W4qxhao6PqOJwcBTfmjcHBfRH/b1qzJnN5RrT6SCOs69bl l8eS8zU6G1/TCcVYS43x7dLHPvteUtyCskLEjs59dXitcYix+aYRZlJnEYQRluGrtpTB YQe1CXjO3pQQKTKN2aIFkeuS/hjMjgIBoLD7OA/MWTY503B/JmYUugzoqqI3oHbgGqL2 RKQw== X-Forwarded-Encrypted: i=1; AJvYcCXsc6dHeMoUwtbKYd/aQ+BFqcjpGK4lCe732KT09pqwpxAfGTpMsGvJjHSe79LNWSQZTZT4vGNXjPAQCNpi@lists.postgresql.org X-Gm-Message-State: AOJu0YyV3QyoNHULtWkTlStPvmkLo+DjrCR2wXIie1saNpHpYs4Y2cps O8DBVpfdw4jJBjV7O2LEOsrwYthDo0Ky22bmQYaKwQWO+Rr128fJPe57shu2O+MhQeGKN6QiqC5 Gpdzbn2T6i8VXZnAF05QNkM3wK58XPm0= X-Gm-Gg: AY/fxX54Vb/KemB3jE+7l0l24LrtvT7YiH/9P4LzVEgvcJihtucROXWq99G4NWFmxNa wZEmJIoEH1CPst1kbjsan/cBLQtpR4SJHCx1z5jtd4YyIRMKSV8sdJrsthLSKHL0pDpl65JiSO9 Buj4Mzr1pwUFq/9Q83tfDKxRLp9AClhL2165AWwmg1BdRn+Y1AaAcfK8mjUXQJYATGNmb/LvE6C xLuINHQs+QKUaU7xfV6SowfmhD0xi0HLTw45EExkyhDRGPb/pqNP0gUZY7gjL77bOWGVK3Z3rLc EyRLKghaWH2s16Yug0v/Krq3LEQHUZ74/iYnfuND05dN7lgr+/w6/JCd3SH1G/xB7T7PMg== X-Google-Smtp-Source: AGHT+IE5Y+dtTlbpVlLl2VO/lmQS3eLQhdB8MLhR3ZZkR6LVv17PBvvkhfsKG8hIAZZM3sZhRjp3U0Q30+0Y080ryy8= X-Received: by 2002:a05:6820:f028:b0:65d:140:8e1 with SMTP id 006d021491bc7-65d0e963e36mr2185637eaf.13.1766230031145; Sat, 20 Dec 2025 03:27:11 -0800 (PST) MIME-Version: 1.0 References: <171085360143.2046436.7217841141682511557.pgcf@coridan.postgresql.org> <2643645f-2a02-43de-9321-c995ab1b7ef8@postgrespro.ru> <57a94d8a-d7b6-4c5e-9001-be1cd403b172@postgrespro.ru> <54414932-9E82-47AA-902B-2DED18F07F64@gmail.com> <3280c458-a886-4c58-8e2b-4d220b73161d@postgrespro.ru> <09414bf8-9326-431c-9422-b13bddf5f554@postgrespro.ru> <29ff27f5-d359-4479-b11c-ce28e525d806@postgrespro.ru> In-Reply-To: From: Alexander Korotkov Date: Sat, 20 Dec 2025 13:26:59 +0200 X-Gm-Features: AQt7F2p6EUglmQR_Xh7xSrgubtipyl9tIfeBOKVh0QFLb46YIQZoZe0ajw40iRk Message-ID: Subject: Re: Add SPLIT PARTITION/MERGE PARTITIONS commands To: jian he Cc: Kirill Reshke , zengman , pgsql-hackers Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Sat, Dec 20, 2025 at 1:15=E2=80=AFPM jian he wrote: > On Sat, Dec 20, 2025 at 6:42=E2=80=AFPM Alexander Korotkov wrote: > > > > Hi Kirill! > > > > reshke=3D# alter table only z merge partitions (z_1,z_2) into z_12; > > > ALTER TABLE > > > reshke=3D# > > > > > > ``` > > > > > > IMO "alter table only ... merge partitions" does not make perfect > > > sense and should be rejected rather than executed. WDYT? > > > > Could you, please, clarify your point? I didn't quite get it. It > > looks like pretty basic example of merging two adjacent partitions. > > > > > reshke=3D# alter table only z merge partitions (z_1,z_2) into z_12; > I think it should fail, because we are not applying to table "z" itself, > For Split/Merge partitions, we are processing the whole partitioned > table z hierarchy. > > alter table z merge partitions (z_1,z_2) into z_12; > should work. > > I guess the attached maybe is what Krill wants. Thank you. I missed there is an ONLY keyword. But I'm not sure about the error message. I don't think the problem with ONLY keyword is that MERGE/SPLIT must be always recursive. I think opposite, it's always non-recursive and this is why ONLY is meaningless. Otherwise, we may decide to just leave it as it allowing ONLY. ------ Regards, Alexander Korotkov Supabase