public inbox for [email protected]
help / color / mirror / Atom feedFrom: jian he <[email protected]>
To: Dmitry Koval <[email protected]>
Cc: PostgreSQL Hackers <[email protected]>
Subject: Re: Re: Add SPLIT PARTITION/MERGE PARTITIONS commands
Date: Wed, 1 Oct 2025 13:01:09 +0800
Message-ID: <CACJufxGc6e5wT3oXs3B8LHEs9pR4z9gmNx_UrX6EX9=pWzNkHg@mail.gmail.com> (raw)
In-Reply-To: <[email protected]>
References: <171085360143.2046436.7217841141682511557.pgcf@coridan.postgresql.org>
<CACJufxEH45Rtkn=n9hjakeKEkH7ou8domh+iQHMp+18Wq_L-4g@mail.gmail.com>
<[email protected]>
<CACJufxGWCVf5r9kE-z6MyR2b+wkaU15Q5m2tKz4cvBhYX3-x1g@mail.gmail.com>
<[email protected]>
<CAPpHfdshkf0C2h09S00TVB8h3x8UT+GZyQ6LK2WGg1hOjnNE4g@mail.gmail.com>
<CAPpHfdsh_jPZ6-2JtWoFeZravVQYY4cYCcnKXQW6KxEx+F5vxg@mail.gmail.com>
<[email protected]>
<CACJufxF1Hfx1PST7pCLrKkGcjHEn2A51znXmYwVccnt5GDORcw@mail.gmail.com>
<[email protected]>
<[email protected]>
<[email protected]>
<CACJufxET9Qe-=zJtjGrKPr7-1QbVcP9y-vJU9CMEDfPGt_dbyg@mail.gmail.com>
<[email protected]>
<CACJufxEBvrtcOWyX2NMwOCvb2ZvaRGaGeiMQpUD=yxL6ncBFOg@mail.gmail.com>
<[email protected]>
hi.
+ /*
+ * For simplify check for ranges of new partitions need to sort all
+ * partitions in ascending order of them bounds (we compare upper
+ * bound only).
+ */
+ lower_bounds = (PartitionRangeBound **)
+ palloc0(nparts * sizeof(PartitionRangeBound *));
+
+ /* Create array of lower bounds. */
+ for (i = 0; i < nparts; i++)
+ {
+ lower_bounds[i] = make_one_partition_rbound(key, i,
+ new_parts[i]->bound->lowerdatums, true);
+ }
+
I am confused by the above comments "we compare upper bound only".
some of the function partition_rbound_cmp can be replaced by marco
compare_range_bounds,
for example in check_two_partitions_bounds_range we can use
compare_range_bounds instead of partition_rbound_cmp
not sure if it's worth it or not.
doc:
<varlistentry id="sql-altertable-split-partition">
should come after
<varlistentry id="sql-altertable-merge-partitions">
I’ve refactored the SPLIT PARTITION docs quite a bit—let me know if they make
sense.
Also tweaked the regression tests a little again.
Attachments:
[application/octet-stream] v61-0001-refactoring-based-on-v61.no-cfbot (28.7K, ../CACJufxGc6e5wT3oXs3B8LHEs9pR4z9gmNx_UrX6EX9=pWzNkHg@mail.gmail.com/2-v61-0001-refactoring-based-on-v61.no-cfbot)
download
view thread (165+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected]
Subject: Re: Re: Add SPLIT PARTITION/MERGE PARTITIONS commands
In-Reply-To: <CACJufxGc6e5wT3oXs3B8LHEs9pR4z9gmNx_UrX6EX9=pWzNkHg@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox