CopyFrom() has become way too complicated

Поиск
Список
Период
Сортировка
От Andres Freund
Тема CopyFrom() has become way too complicated
Дата
Msg-id 20181012181337.b43fka3y64wlbvx4@alap3.anarazel.de
обсуждение исходный текст
Ответы Re: CopyFrom() has become way too complicated
Список pgsql-hackers
Hi,

I've had to whack CopyFrom() around a couple times due to the pluggable
storage patch, and I found that after
commit 0d5f05cde011512e605bb2688d9b1fbb5b3ae152
Author: Peter Eisentraut <peter_e@gmx.net>
Date:   2018-08-01 10:23:09 +0200

    Allow multi-inserts during COPY into a partitioned table

and also the previous partition support changes, the CopyFrom() code
has, for me at least, become very hard to follow.

I think the code needs to be split up so that CopyFrom() in the loop
body calls CopyFromOneTuple(), which then also splits out the tuple
routing into its own CopyFromOneTupleRoute() function (that's 200 LOC on
its own...). I suspect it'd also be good to refactor the
partition-change code out into its own function.

Greetings,

Andres Freund


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

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: Multi-insert into a partitioned table with before insert rowtrigger causes server crash on latest HEAD
Следующее
От: Tom Lane
Дата:
Сообщение: Re: AllocSetContextCreate changes breake extensions