Re: CustomScan support on readfuncs.c

Поиск
Список
Период
Сортировка
От Amit Kapila
Тема Re: CustomScan support on readfuncs.c
Дата
Msg-id CAA4eK1L+UpNA6wDHbcADuFHCagJWaSUVqXEcVTVveV57954cTQ@mail.gmail.com
обсуждение исходный текст
Ответ на CustomScan support on readfuncs.c  (Kouhei Kaigai <kaigai@ak.jp.nec.com>)
Список pgsql-hackers
On Fri, Sep 25, 2015 at 6:49 AM, Kouhei Kaigai <kaigai@ak.jp.nec.com> wrote:
Hi,

I tried to define two additional callbacks to support CustomScan
on readfuncs.c.

First of all, we need to pay attention how to treat output of
TextOutCustomScan when additional text output is generated.
Only custom-scan provider knows what shall be displayed, so
all we can do is invoke a new callback: TextReadCustomScan().
Because private fields shall be displayed next to the common
field of CustomScan, this callback is invoked once pg_strtok
pointer reached to the last field of CustomScan. Then, custom
scan provider allocates CustomScan or a structure embedding
CustomScan; only CSP knows exact size to be allocated.
It can fetch some tokens using pg_strtok and reconstruct its
private fields, but no need to restore the common field because
it shall be done by _readCustomScan.

So will the specification of TextReadCustomScan() and
TextOutCustomScan() ensures that they don't access the common
fields (like custom_private or others) of CustomScan?
If they change/overwrite them in some way, then I think _readCustomScan()
won't work because it doesn't take into account that common fields could
have been updated by TextReadCustomScan().



With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com

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

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: In-core regression tests for replication, cascading, archiving, PITR, etc.
Следующее
От: Kouhei Kaigai
Дата:
Сообщение: Re: CustomScan support on readfuncs.c