[PATCH] Writing changes of decoding plugin in the memory context where data is kept?

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема [PATCH] Writing changes of decoding plugin in the memory context where data is kept?
Дата
Msg-id CAB7nPqT2jwWWYf=kng-_06Ss3qM3DKJzXQrojF0B-NJgcP2sdA@mail.gmail.com
обсуждение исходный текст
Ответы Re: [PATCH] Writing changes of decoding plugin in the memory context where data is kept?
Список pgsql-hackers
Hi all,

When working on a decoder plugin, I have been pointed that it is
incorrect to write changes in an output plugin while not being in the
memory context where changes are written.
In pg_decode_change@test_decoding.c, we do the following:
old = MemoryContextSwitchTo(data->context);
OutputPluginPrepareWrite(ctx, true);
[...]
MemoryContextSwitchTo(old);
MemoryContextReset(data->context);
OutputPluginWrite(ctx, true);

Wouldn't it be better to call OutputPluginWrite before switching back
to the old context? The attached patch for test_decoding does so.
Comments welcome.
Regards,
--
Michael

Вложения

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

Предыдущее
От: Tomas Vondra
Дата:
Сообщение: Re: Sending out a request for more buildfarm animals?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Cache invalidation bug in RelationGetIndexAttrBitmap()