Re: MERGE PARTITIONS and DEPENDS ON EXTENSION.

From: "Matheus Alcantara" <matheusssilv97(at)gmail(dot)com>
To: "Alexander Korotkov" <aekorotkov(at)gmail(dot)com>
Cc: "Dmitry Koval" <d(dot)koval(at)postgrespro(dot)ru>, "pgsql-hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: MERGE PARTITIONS and DEPENDS ON EXTENSION.
Date: 2026-04-21 13:20:50
Message-ID: DHYV404JC894.P813UU2Y36L1@gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon Apr 20, 2026 at 4:08 PM -03, Alexander Korotkov wrote:
> On Thu, Apr 16, 2026 at 9:03 PM Matheus Alcantara
> <matheusssilv97(at)gmail(dot)com> wrote:
>>
>> On Tue Apr 14, 2026 at 6:05 AM -03, Dmitry Koval wrote:
>> > Hi Matheus!
>> >
>> > Thank you for patch.
>> > I agree that dependency should be automatically added for SPLIT
>> > PARTITION. But I'm not sure about MERGE PARTITION ...
>> > Might be it would be more correct to automatically add a dependency only
>> > if all merged partitions have it?
>>
>> Hi,
>>
>> Thank you for taking a look on this!
>>
>> I agree with your suggestion. The attached patch implements the
>> intersection behavior for MERGE PARTITIONS: extension dependencies are
>> only preserved on the merged partition's index if all source partition
>> indexes have that dependency.
>>
>> For example:
>> MERGE(idx1(ext_a, ext_b), idx2(ext_a)) -> idx3(ext_a) -- only ext_a is common
>> MERGE(idx1(ext_a), idx2()) -> idx3() -- no common deps
>
> This is not obvious for me. I would rather trigger an error if there
> are different dependencies on merging partitions.
>

Yeah, I agree that this sounds a bit confusing, although this behavior
is documented on the last patch version I think that raising an error is
more simple and maybe is more obvious. The attached patch implement
this.

--
Matheus Alcantara
EDB: https://www.enterprisedb.com

Attachment Content-Type Size
v5-0001-Preserve-extension-dependencies-on-indexes-during.patch text/plain 27.5 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Aleksander Alekseev 2026-04-21 13:40:49 [PATCH] Fix null pointer dereference in PG19
Previous Message Daniil Davydov 2026-04-21 13:17:15 Re: Fix bug with accessing to temporary tables of other sessions