public inbox for [email protected]
help / color / mirror / Atom feedFrom: Matheus Alcantara <[email protected]>
To: Kirill Reshke <[email protected]>
Cc: Alexander Korotkov <[email protected]>
Cc: Dmitry Koval <[email protected]>
Cc: pgsql-hackers <[email protected]>
Subject: Re: MERGE PARTITIONS and DEPENDS ON EXTENSION.
Date: Wed, 22 Apr 2026 08:05:47 -0300
Message-ID: <[email protected]> (raw)
In-Reply-To: <CALdSSPj2t7voOsC+XOra7utm1=bGfwHG1Yk+kvSRAWst0s3fCw@mail.gmail.com>
References: <CALdSSPjXtzGM7Uk4fWRwRMXcCczge5uNirPQcYCHKPAWPkp9iQ@mail.gmail.com>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<CAPpHfdvQSmRAHu1BRTVcvgons_Smt0QW+mLP4np=QxG==WyFAg@mail.gmail.com>
<[email protected]>
<CAPpHfds2NsGvpi4fK-xBDk9S=ZY8FEsG-a3z7m_cRSJhn5GKvQ@mail.gmail.com>
<[email protected]>
<CAPpHfdt66RjWZnUakTZKk6eQ=xVrscfp9HAg8xXnxjnsgHuF-g@mail.gmail.com>
<CALdSSPi9GE8jnLCA4aUP2F5_ax6W9Ccfh_ja0iY6wkX2uUyzDw@mail.gmail.com>
<[email protected]>
<CALdSSPj2t7voOsC+XOra7utm1=bGfwHG1Yk+kvSRAWst0s3fCw@mail.gmail.com>
On Wed Apr 22, 2026 at 7:59 AM -03, Kirill Reshke wrote:
> On Wed, 22 Apr 2026 at 15:58, Matheus Alcantara
> <[email protected]> wrote:
>>
>> On Wed Apr 22, 2026 at 7:48 AM -03, Kirill Reshke wrote:
>> >> +-- An index created directly on a partition has no parent in the partitioned
>> >> +-- index tree; merge must ignore such indexes (they disappear with the old
>> >> +-- partition).
>> >> +CREATE INDEX part_extdep_3_extra_idx ON part_extdep_3(x);
>> >> +ALTER TABLE part_extdep MERGE PARTITIONS (part_extdep_merged, part_extdep_3)
>> >> + INTO part_extdep_merged2;
>> >> +SELECT relname FROM pg_class
>> >> +WHERE relname LIKE 'part_extdep_merged2%idx' ORDER BY relname;
>> >
>> > Looks like this test is also redundant? This does not test new DEPENDS ON logic.
>> >
>>
>> I think that this test is useful to ensure that we correctly skip such
>> indexes created directly on a specific partition. Perhaps we can include
>> an ALTER INDEX ... DEPENDS ON for this specific index to make it more
>> consistent with the other tests?
>
> This test is maybe useful, but this is unrelated to what this thread &
> fix is about, for my taste.
>
On collectPartitionIndexExtDeps() we have:
if (!get_rel_relispartition(indexOid))
continue;
parentIndexOid = get_partition_parent(indexOid, true);
if (!OidIsValid(parentIndexOid))
continue;
I think that this test ensure that get_rel_relispartition() check is
called, otherwise we will call get_partition_parent() with an index that
don't have parent which will fail with an elog(ERROR).
It can be unrelated but I think that it ensure correctness for this fix,
or I'm missing something here?
--
Matheus Alcantara
EDB: https://www.enterprisedb.com
view thread (21+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected], [email protected]
Subject: Re: MERGE PARTITIONS and DEPENDS ON EXTENSION.
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox