Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

From: Dmitry Koval <d(dot)koval(at)postgrespro(dot)ru>
To: jian he <jian(dot)universality(at)gmail(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Add SPLIT PARTITION/MERGE PARTITIONS commands
Date: 2025-06-18 23:12:38
Message-ID: df72c242-a099-4d11-b02e-8ee8474c0455@postgrespro.ru
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi!

1.
>v47-0001-rename-function-argument-and-minor-refactor.no-cfbot

Thanks, applied.

2.
>+ * Construct a map from the LIKE relation's attnos to the child rel's
>this comment in createTableConstraints is confusing, especially the
> word "LIKE". I didn' change it though.

It is copy from expandTableLikeClause function. Changed.

3.
>the argument (Relation rel) never used in moveMergedTablesRows
>we can remove it, or rename it as "parent_rel".
>I didn' change it though.

Removed.

4.
>moveMergedTablesRows was never used in SPLIT PARTITION,
>so maybe we can rename it to
>ATMergePartitionMoveTablesRows
>or
>ATMergePartitionMoveRows
>or
>ATMergePartitionRows
>what do you think?

I like the name "MergePartitionsMoveRows" (without prefix "AT" - "ALTER
TABLE", because this function is not called from ATExecCmd function).
Is it ok?

5.
>so I added a test for it. as you can see below, the error HINT message
>is not great in this context.
...
>HINT: Use DROP ... CASCADE to drop the dependent objects too.

Maybe a special flag (DEPFLAG_NOHINT?) should be added to skip hints for
the performDeletionCheck function?

--
With best regards,
Dmitry Koval

Postgres Professional: http://postgrespro.com

Attachment Content-Type Size
v48-0001-Implement-ALTER-TABLE-.-MERGE-PARTITIONS-.-comma.patch text/plain 165.9 KB
v48-0002-Implement-ALTER-TABLE-.-SPLIT-PARTITION-.-comman.patch text/plain 219.3 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2025-06-19 00:41:22 Making Row Comparison NULL row member handling more robust during skip scans
Previous Message Thomas Munro 2025-06-18 22:18:21 Re: Non-reproducible AIO failure