Re: Add SPLIT PARTITION/MERGE PARTITIONS commands - Mailing list pgsql-hackers

From jian he
Subject Re: Add SPLIT PARTITION/MERGE PARTITIONS commands
Date
Msg-id CACJufxGkVBQCj+fP=Dpy3-Hnkay6UqYwnWY+h_GaMgz0UGa9LQ@mail.gmail.com
Whole thread Raw
In response to Re: Add SPLIT PARTITION/MERGE PARTITIONS commands  (Dmitry Koval <d.koval@postgrespro.ru>)
Responses Re: Add SPLIT PARTITION/MERGE PARTITIONS commands
List pgsql-hackers
On Wed, Sep 17, 2025 at 6:08 AM Dmitry Koval <d.koval@postgrespro.ru> wrote:
>
> 2. Patch v56-0001-refactor-v56-check_partitions_for_split.no-cfbot
> applied with cosmetic changes.
>

hi.

check_two_partitions_bounds_range
        ereport(ERROR,
                errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
                merge_split
                ? errmsg("can not merge partition \"%s\" together with
partition \"%s\"",
                         second_name->relname, first_name->relname)
                : errmsg("can not split to partition \"%s\" together
with partition \"%s\"",
                         second_name->relname, first_name->relname),
                errdetail("lower bound of partition \"%s\" is not
equal to the upper bound of partition \"%s\"",
                          second_name->relname, first_name->relname),
                merge_split
                ? errhint("ALTER TABLE ... MERGE PARTITIONS requires
the partition bounds to be adjacent.")
                : errhint("ALTER TABLE ... SPLIT PARTITIONS requires
the partition bounds to be adjacent."),
                parser_errposition(pstate, datum->location));

This is too much...., also bad for translation, so I refactored this.
I also refactored check_partition_bounds_for_split_range.

In ATExecSplitPartition,
"char        relname[NAMEDATALEN];" is not necessary?

Attachment

pgsql-hackers by date:

Previous
From: Shubham Khanna
Date:
Subject: Re: Add support for specifying tables in pg_createsubscriber.
Next
From: Chao Li
Date:
Subject: Re: Add SPLIT PARTITION/MERGE PARTITIONS commands