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 1vWvHq-00Crw0-1H for pgsql-hackers@arkaria.postgresql.org; Sat, 20 Dec 2025 11:38:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vWvHo-00ANGB-2W for pgsql-hackers@arkaria.postgresql.org; Sat, 20 Dec 2025 11:38:13 +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 1vWvHo-00ANG2-15 for pgsql-hackers@lists.postgresql.org; Sat, 20 Dec 2025 11:38:13 +0000 Received: from mail-qt1-x834.google.com ([2607:f8b0:4864:20::834]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vWvHn-001evX-0i for pgsql-hackers@lists.postgresql.org; Sat, 20 Dec 2025 11:38:11 +0000 Received: by mail-qt1-x834.google.com with SMTP id d75a77b69052e-4eda6a8cc12so26651591cf.0 for ; Sat, 20 Dec 2025 03:38:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1766230690; x=1766835490; 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=AUFANiXeOj0mb8rvBoC1+1uQr1ZlLPo3AQcozVOQSqM=; b=PgLfhsKWu4xJ2IMaPzWrFoB0xXnPTKSNaagUcSU+EhpF3poCTBXAtDiLIKfgNh+Jn9 gwE/Df45tGXJ4H4N+tZGDowgCAw/elpfG/fwXKUlttg0noWeuqIBBBg0HWN0s1ywcCLX l7akzgYMhGIh4qMGK2BUXQlV3sZsajrFZYT/KUKvr1rAQapoceP5yvMHdv7lxskC0gF0 SvUvpfRx6tbsne3B8xN6Dig8CtbyDt6a9y+L4LPawraPfXjm1Hgf8addCx8yBB2unKBj Sl0uud2mzfACneejsQe2m5tvknLqaSKTm8wwMnVgEHZZfKHOImxlBX9HKuAZmC4ul8HQ PTKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1766230690; x=1766835490; 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=AUFANiXeOj0mb8rvBoC1+1uQr1ZlLPo3AQcozVOQSqM=; b=TbjfcoisifDYv2tcFKWsXSnJjmEtB/3+MpjsGSAkSW1FkdT4ta8bs8kdjCCPhc8yox B4T1Fh1dSbAjLmW/xS1hGkP87dE/e6SEqxr+eZt4hUWaXHss1O6zB0g5fNgR+xyDF+Co nDSPWEkP9dloBNrvfyKRkyJMEqKWvJP2B9eOWXp/X+H+yEI1oJzz/BAE5ZpDn18fno47 JSj9kigkLUTFVMocr/OGfhH8dbsGF546dTErdr8XIWoWRqHlbmjQPW4/dmNMkLmcHdfk FJ0OmDReaAX2UMIIBS2jw8hteqNOc12glHdRX01RJfuU5ASomOfPccFEXx6uP1RUPt6H DUhg== X-Forwarded-Encrypted: i=1; AJvYcCXzwmwucXipbXNqfOMUS/JqPtA9f/btlLG9EZbgQLEo8cvewI6tXnmx0Wl6NuxrcjE3UBM89N4YoBmFBp0p@lists.postgresql.org X-Gm-Message-State: AOJu0YyCgoGXt5W85G3emPyOrnxm9rXAWlUrds3plypD+MoCZ7BnfdK9 Q1M4C6nTw4pANN8PQ1qhHNR5y1sIa290b6wiJifxIhKMuBvl4qtnr/X/74gVjsH+82L/GumjDrc b6wi3/M8p/oHVemUKeCfjsN3/2KAOxz4= X-Gm-Gg: AY/fxX6fuSHGLyWqBn3nVoXulA9dhlRLgOzWXRXntUWLE2lScjGyf6DuoUJGpMvd8WJ rWvFUd3jB+BBEIDCkq3QqYLbEPD8DsAi9sEm0ImebrP39pZgNqAdS8TdTyHQ6AnHNvnhUM4Msk/ S/KpGw47KTUfbgD5dy7Wa/mbJnTKy/kViHokL2AMWRcIaZGf38CdCV1bOg2rHfQQnSfyt54majw 0qSg2zJ0az0VCQZTzpdQEFgEJ6QXA0e9xBtQgEBNbusA79NJ8I5XJFiD4rJFQnXPtFZldo7 X-Google-Smtp-Source: AGHT+IGvKtTt65ffj8oAiT24jC6dDWBHOA4FUbn0/+y4CAkfwxwRbWnTd2IbVDBZsH++G+ei+s7ssNEFNjvwrcRw+IU= X-Received: by 2002:ac8:5882:0:b0:4ee:4126:661c with SMTP id d75a77b69052e-4f4abdcb96emr83282001cf.81.1766230690109; Sat, 20 Dec 2025 03:38:10 -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: Kirill Reshke Date: Sat, 20 Dec 2025 16:37:57 +0500 X-Gm-Features: AQt7F2rVyMwJfOLfN1QBfXbn0dc45ioCfVjKHUYt71b7lvKvvEJRtbivYKjWI2k Message-ID: Subject: Re: Add SPLIT PARTITION/MERGE PARTITIONS commands To: Alexander Korotkov Cc: jian he , 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, 20 Dec 2025 at 16:27, Alexander Korotkov wro= te: > > 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. Jian, Thank, you got me right. Your patch is addressing the problem I talk about, yes. The only issue about your patch is the actual error message (error hint is exactly on point.) So, instead of ``` +ERROR: ALTER TABLE MERGE PARTITIONS must apply to child tables too +HINT: Do not specify the ONLY keyword. `` I would prefer (something like) ``` +ERROR: ALTER TABLE MERGE PARTITIONS is a non-recursive command. +HINT: Do not specify the ONLY keyword. `` On Sat, 20 Dec 2025 at 16:27, Alexander Korotkov wro= te: > 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. +1 --=20 Best regards, Kirill Reshke