Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

From: Alexander Korotkov <aekorotkov(at)gmail(dot)com>
To: Pavel Borisov <pashkin(dot)elfe(at)gmail(dot)com>
Cc: Justin Pryzby <pryzby(at)telsasoft(dot)com>, Dmitry Koval <d(dot)koval(at)postgrespro(dot)ru>, Alexander Lakhin <exclusion(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org, Tomas Vondra <tomas(dot)vondra(at)enterprisedb(dot)com>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Subject: Re: Add SPLIT PARTITION/MERGE PARTITIONS commands
Date: 2026-06-16 12:22:02
Message-ID: CAPpHfdtVp5Xxz59Zse+Gg_oWvZPpwjr+gcVtWq-5pTp0Rsh8gQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi, Pavel!

On Tue, Jun 16, 2026 at 12:57 AM Pavel Borisov <pashkin(dot)elfe(at)gmail(dot)com> wrote:
> I looked into the patch. It's simple enough and looks good to me.
> I have one question: is it correct to pass 0 reloptions to
> NewRelationCreateToastTable or we need to use transformRelOptions +
> heap_reloptions pair to derive toast_reloptions as it is done in
> ProcessUtilitySlow() and create_ctas_internal()?

Yes, (Datum) 0 is correct here. MERGE/SPLIT PARTITION grammar
provides no syntactic way for the user to specify reloptions for the
new partitions, so there is nothing to extract via
transformRelOptions. This matches createPartitionTable() itself,
which already calls heap_create_with_catalog(... reloptions=(Datum) 0
...) for the main relation a few lines above; the TOAST table just
inherits that choice.

Extending the syntax to accept WITH (...) on new partitions would be a
separate, larger feature. Out of scope for this bug fix.

------
Regards,
Alexander Korotkov
Supabase

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tomas Vondra 2026-06-16 12:39:45 Re: Adding basic NUMA awareness
Previous Message Alexander Korotkov 2026-06-16 12:19:13 Re: Add SPLIT PARTITION/MERGE PARTITIONS commands