Three more loops that let a function drop a not-yet-processed index/partition

Поиск
Список
Период
Сортировка
Искать

Three more loops that let a function drop a not-yet-processed index/partition

От:
Baji Shaik <baji.pgdev@gmail.com>
Дата:
Вложения:
Hi,

While looking at d94964f14f39, I noticed a similar issue in a couple of other
code paths which fail with "could not open relation with OID ..." or a
cache lookup failure. This happens in plain REINDEX TABLE, CREATE INDEX on
a partitioned table, and ALTER TABLE ... ATTACH PARTITION.

I think we can provide a similar fix, that is, pin the not-yet-processed
relations open and release each pin right before it's processed, so the
self-drop fails cleanly via CheckTableNotInUse() instead.

Please find the attached patches.

Thoughts?

Thanks,
Baji Shaik

Re: Three more loops that let a function drop a not-yet-processed index/partition

От:
Michael Paquier <michael@paquier.xyz>
Дата:
Вложения:
On Fri, Nov 20, 2026 at 07:00:49PM -0600, Baji Shaik wrote:
> While looking at d94964f14f39, I noticed a similar issue in a couple of
> other
> code paths which fail with "could not open relation with OID ..." or a
> cache lookup failure. This happens in plain REINDEX TABLE

Yep.  I was aware of this one already, just did not get down to look
at how to fix it in more details.  At quick glance, that seems
sensible.  Thanks for the patch.

> CREATE INDEX on
> a partitioned table, and ALTER TABLE ... ATTACH PARTITION.

I have not looked at these two.
--
Michael
FAQ