Re: Fast COPY FROM based on batch insert

Поиск
Список
Период
Сортировка
От Etsuro Fujita
Тема Re: Fast COPY FROM based on batch insert
Дата
Msg-id CAPmGK16aE1oO-AP_rjGLc8yf_OK_eoF1mQqsHVEzFu2WptXLMQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Fast COPY FROM based on batch insert  (Andrey Lepikhov <a.lepikhov@postgrespro.ru>)
Ответы Re: Fast COPY FROM based on batch insert
Список pgsql-hackers
On Tue, Oct 11, 2022 at 3:06 PM Andrey Lepikhov
<a.lepikhov@postgrespro.ru> wrote:
> I reviewed the patch one more time. Only one question: bistate and
> ri_FdwRoutine are strongly bounded. Maybe to add some assertion on
> (ri_FdwRoutine XOR bistate) ? Just to prevent possible errors in future.

You mean the bistate member of CopyMultiInsertBuffer?

We do not use that member at all for foreign tables, so the patch
avoids initializing that member in CopyMultiInsertBufferInit() when
called for a foreign table.  So we have bistate = NULL for foreign
tables (and bistate != NULL for plain tables), as you mentioned above.
I think it is a good idea to add such assertions.  How about adding
them to CopyMultiInsertBufferFlush() and
CopyMultiInsertBufferCleanup() like the attached?  In the attached I
updated comments a bit further as well.

Thanks for reviewing!

Best regards,
Etsuro Fujita

Вложения

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

Предыдущее
От: David Rowley
Дата:
Сообщение: Allow WindowFuncs prosupport function to use more optimal WindowClause options
Следующее
От: Masahiko Sawada
Дата:
Сообщение: Re: test_decoding assertion failure for the loss of top-sub transaction relationship