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

From Alexander Korotkov
Subject Re: Add SPLIT PARTITION/MERGE PARTITIONS commands
Date
Msg-id CAPpHfdvSBR+sbsRCAybN949tOGArQvMH2QeDXf2L=7NDMNbJfw@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 Mon, Sep 22, 2025 at 11:12 PM Dmitry Koval <d.koval@postgrespro.ru> wrote:
Hi, Jiah He!

1.
 >duplicated CommandCounterIncrement call?

Probably this duplication is necessary to rename partition correctly ...

The second CommandCounterIncrement() is needed to make the renamed relation visible within our transaction.  Why do we need the first one?  I see tests pass without it.

Also, I doubt this is correct in the partitions_listdatum_intersection() function.

    foreach_node(Const, val1, list1)
    {
        if (val1->constisnull)
        {
            if (isnull2)
            {
                result = lappend(result, val1);
                return result;
            }
            isnull1 = true;
            continue;
        }

The branch handling null value in the outer loop, uses null2 flag from the inner loop.  I think for the null value of the outer loop we still need to run inner loop to search for the matching null value.

------
Regards,
Alexander Korotkov
Supabase

pgsql-hackers by date:

Previous
From: Aleksander Alekseev
Date:
Subject: Re: [PATCH] pg_bsd_indent: improve formatting of multiline comments
Next
From: Pradeep Kumar
Date:
Subject: Re: Assertion failure in SnapBuildInitialSnapshot()