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 1uTygs-00DHTM-Ep for pgsql-hackers@arkaria.postgresql.org; Tue, 24 Jun 2025 08:07:38 +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 1uTygp-00AI8F-By for pgsql-hackers@arkaria.postgresql.org; Tue, 24 Jun 2025 08:07:36 +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.94.2) (envelope-from ) id 1uTygp-00AI87-2e for pgsql-hackers@lists.postgresql.org; Tue, 24 Jun 2025 08:07:35 +0000 Received: from mail-vs1-xe35.google.com ([2607:f8b0:4864:20::e35]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uTygo-003hAB-06 for pgsql-hackers@lists.postgresql.org; Tue, 24 Jun 2025 08:07:34 +0000 Received: by mail-vs1-xe35.google.com with SMTP id ada2fe7eead31-4e7ade16082so1407742137.1 for ; Tue, 24 Jun 2025 01:07:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1750752453; x=1751357253; 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=dI6eGTn/oZu/sF+Ihqa9cpb2dOMJwJVZDNOXprpTJgs=; b=S4rxWUMxPrk8+MZgOHtsdNW1UrOFkx8Rz73iy19+T9OEBtcc2eiEc0BBdmOSzmPLaz IhnqU0hYdXRVrPbAjYt36mJJX5LkzulW8yNY4mfd3CSt900Q9blHt31o6dsNlN1r9TJ2 R+P9bgkQo591LYeb/2fKu8dE5/EFvZmfXYVngzTLmzArQBweNx4tHuyaqkQIPFUE2mGh FtEEPxBcwykTudbWzWFptqWy4/3aYqHqquSZeO1NWoTHxFY+FJYvDmqKxqdjdMYRbnIO E/K4A2SlKsD6OCsy7Ff616WvOO6as+ChDTqlzzZPoSX5dVdgPuGCQUnbWiO8yR9P8sV1 JNuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1750752453; x=1751357253; 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=dI6eGTn/oZu/sF+Ihqa9cpb2dOMJwJVZDNOXprpTJgs=; b=trz97bHfr4cyXcJoWYCe3+YMlq2mhqoDdJtibaTNYzZmxDFJjhke6QIkUuwN2OX7Lv iOVgRJY3aZgmoz4ufIjYuX0Bzg02qP9anBzZ/CBHXP0KgBLRK8arx4KRIFSw7xI/CdNa 0VRGVdSfu9IpOifNK9yJ8/UFFALa4Gtx0reoq+ZQGpdYAoe5/OGweJx/2RR8/5jtTYg5 fA2+gV8csxtOvwI3nh5IgMxTnBtjq22Yev9uoA940ciTI43kGSQfraIx9/TEROFutJfj fCi274kHtEoXonzubFwGoNRxV613AHBCNiVnWAdH+7BPsbO1OONU3X6FhZxPN+fFCSym hbJg== X-Gm-Message-State: AOJu0YyJ/77rcO9t7GAber69gl6qJFEOXCR1wb+W3CLrr56yYRj+RpKl cq0honJnzjwCGKE7a1YWWCwBJV9RPOLQFrArtoEEhLvuP2RaF5FJyMxP8Or9w2K7FQmJE36j9K6 2VTXVhtTA6wKPrJJxao/K3P5BEE1WchA= X-Gm-Gg: ASbGnctY2dLHgj5jYD5hfGjPevMyr+BwG2Wne5hH8O0Qwbm3amfh0JfhbKFsJvKa8pe puTJO36xLZhPpxdara+y4m9gDSdYyN2uncy7j9+OTZYTQ9SXYP6Dm7ZjL2QSFCXLnWwqK7WPebL 5KY9p3RVA433VaarzUEKwczodkMAF0ZV2EdkdEHeZTwx4nmjYdWU9sStKvQ+UoYSLU2RguOifib g== X-Google-Smtp-Source: AGHT+IHvjKaABuxI9ma3rmTklpHGYhqO85/jFjopTc9KWup2YQzelNRiKFXYoJMMrj1J45//YwlxUJ7cHRe38wDoM58= X-Received: by 2002:a05:6102:5715:b0:4e2:ecd8:a27 with SMTP id ada2fe7eead31-4e9c2a91edamr8724038137.4.1750752452534; Tue, 24 Jun 2025 01:07:32 -0700 (PDT) MIME-Version: 1.0 References: <171085360143.2046436.7217841141682511557.pgcf@coridan.postgresql.org> <884bcf9e-d6e3-4b0c-8dcb-7f2110070ac9@postgrespro.ru> <1e74c9fd-830e-4544-b0de-e49ea4b04029@postgrespro.ru> <9c1b75f1-5c40-4a86-9a61-a4b3f1d7ec60@postgrespro.ru> <7e1c67b8-ceba-4a04-964a-853eedeb02cc@postgrespro.ru> <0b3907b4-83b9-4873-9feb-2b60b29cda33@postgrespro.ru> <4f19550b-eb41-4649-8bf5-566dc020a720@postgrespro.ru> In-Reply-To: From: jian he Date: Tue, 24 Jun 2025 16:06:56 +0800 X-Gm-Features: Ac12FXw9worPs-H6T902uVLmRvPAa7ZUeFsgPjtvhPXCAyM4svT3VcxKbEMwZAA Message-ID: Subject: Re: Add SPLIT PARTITION/MERGE PARTITIONS commands To: Dmitry Koval Cc: pgsql-hackers@lists.postgresql.org Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk hi. + /* Sort array of lower bounds. */ + qsort_arg(lower_bounds, nparts, sizeof(PartitionRangeBound *), + qsort_partition_rbound_cmp, (void *) key); here, we don't need ``(void *)`` +ALTER TABLE [ IF EXISTS ] name + MERGE PARTITIONS (partition_name1, partition_name2 [, ...]) + INTO partition_name In the synopsis section, we can combine the last two lines into one for better formatting. after we can add the following to briefly explain parameters: partition_name1, partition_name2 partition_name1 partition_name2 The names of the tables being merged into the new partition. What do you think about alternative syntax: ALTER TABLE tab1 MERGE PARTITION part1 WITH (part2, part3) mentioned in [1]. I think we need to settle this issue before moving forward. If the current MERGE PARTITION design is finalized, then v48-0001 looks solid. [1] https://postgr.es/m/CA+TgmoY0=bT_xBP8csR=MFE=FxGE2n2-me2-31jBOgEcLvW7ug@mail.gmail.com