Re: [HACKERS] Index created in BEFORE trigger not updated duringINSERT

Поиск
Список
Период
Сортировка
От Albe Laurenz
Тема Re: [HACKERS] Index created in BEFORE trigger not updated duringINSERT
Дата
Msg-id A737B7A37273E048B164557ADEF4A58B53A538A9@ntex2010i.host.magwien.gv.at
обсуждение исходный текст
Ответ на Re: [HACKERS] Index created in BEFORE trigger not updated during INSERT  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Tom Lane wrote:
>> Andres Freund <andres@anarazel.de> writes:
>>> Hm, strategically sprinkled CheckTableNotInUse() might do the trick?
> 
> Attached is a proposed patch that closes off this problem.  I've tested
> it to the extent that it blocks Albe's example and passes check-world.

I tested it, and it works fine.  Thanks!

> I'm unsure whether to back-patch or not; the main argument for not doing
> so is that if any extensions are calling DefineIndex() directly, this
> would be an API break for them.  Given what a weird case this is, I'm not
> sure it's worth that.
> 
> A possible end-run around the API objection would be to not add an extra
> argument to DefineIndex() in the back branches, but to use !is_alter_table
> as the control condition.  That would work for the core callers, although
> we might need a special case for bootstrap mode.  On the other hand,
> thinking again about hypothetical third-party callers, it's possible that
> that's not the right answer for them, in which case they'd be really in
> trouble.  So I'm not that much in love with that answer.

It causes a slight bellyache to leave an unfixed data corruption bug
in the back branches (if only index corruption), but I agree that it is
such a weird case to create an index in a BEFORE trigger that we probably
can live without a back-patch.

Yours,
Laurenz Albe

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: [HACKERS] Challenges preventing us moving to 64 bit transactionid (XID)?
Следующее
От: "Sven R. Kunze"
Дата:
Сообщение: Re: [HACKERS] Use of non-restart-safe storage by temp_tablespaces