On Wed, Jun 21, 2017 at 11:37 PM, Alex K <kondratov.alek...@gmail.com> wrote: >> On 16 Jun 2017, at 21:30, Alexey Kondratov <kondratov.alek...@gmail.com> >> wrote: > >> > On 13 Jun 2017, at 01:44, Peter Geoghegan <p...@bowt.ie> wrote: > > >> > Speculative insertion has the following special entry points to >> > heapam.c and execIndexing.c, currently only called within >> > nodeModifyTable.c > >> > Offhand, it doesn't seem like it would be that hard to teach another >> > heap_insert() caller the same tricks. > > >> I went through the nodeModifyTable.c code and it seems not to be so >> difficult to do the same inside COPY. > > After a more precise look, I have figured out at least one difficulty, COPY > and INSERT follow the different execution paths: INSERT goes through > the Planner, while COPY does not. It leads to the absence of some required > attributes like arbiterIndexes, which are available during INSERT via > PlanState/ModifyTableState. Probably it is possible to get the same in the > COPY, but it is not clear for me how. > > Anyway, adding of the 'speculative insertion' into the COPY is worth of a > separated patch; and I would be glad to try implementing it. > > In the same time I have prepared a complete working patch with: > > - ignoring of the input data formatting errors > - IGNORE_ERRORS parameter in the COPY options > - updated regression tests > > Please, find the patch attached or check the web UI diff on GitHub as always: > https://github.com/ololobus/postgres/pull/1/files
"git diff master --check" complains heavily, and the patch does not apply anymore. The last patch is 5-month old as well, so I am marking the patch as returned with feedback. -- Michael