Re: lsyscache: free IndexAmRoutine objects returned by GetIndexAmRoutineByAmId()

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: lsyscache: free IndexAmRoutine objects returned by GetIndexAmRoutineByAmId()
Дата
Msg-id 2992607.1767035845@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: lsyscache: free IndexAmRoutine objects returned by GetIndexAmRoutineByAmId()  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
... oh, one other thought: instead of what you did in
InitIndexAmRoutine, we should probably do something like

{
    MemoryContext oldcontext;

    /*
     * We formerly specified that the amhandler should return a
     * palloc'd struct.  That's now deprecated in favor of returning
     * a pointer to a static struct, but to avoid completely breaking
     * old external AMs, run the amhandler in the relation's rd_indexcxt.
     */
    oldcontext = MemoryContextSwitchTo(relation->rd_indexcxt);
    relation->rd_indam = GetIndexAmRoutine(relation->rd_amhandler);
    MemoryContextSwitchTo(oldcontext);
}

            regards, tom lane



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