Re: [POC] Fast COPY FROM command for the table with foreign partitions
Zhihong Yu <zyu@yugabyte.com>
From: Zhihong Yu <zyu@yugabyte.com>
To: Justin Pryzby <pryzby@telsasoft.com>
Cc: "Tsunakawa, Takayuki" <tsunakawa.takay@fujitsu.com>, Andrey Lepikhov <a.lepikhov@postgrespro.ru>,
Amit Langote <amitlangote09@gmail.com>, tanghy.fnst@fujitsu.com, Alexey Kondratov <a.kondratov@postgrespro.ru>, Michael Paquier <michael@paquier.xyz>,
Ashutosh Bapat <ashutosh.bapat@2ndquadrant.com>, Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>,
Etsuro Fujita <etsuro.fujita@gmail.com>, PostgreSQL-development <pgsql-hackers@postgresql.org>,
Tomas Vondra <tomas.vondra@enterprisedb.com>, houzj.fnst@fujitsu.com
Date: 2021-04-09T01:42:40Z
Lists: pgsql-hackers
On Thu, Apr 8, 2021 at 5:49 PM Justin Pryzby <pryzby@telsasoft.com> wrote: > I rebased this patch to resolve a trivial 1 line conflict from c5b7ba4e6. > > -- > Justin > Hi, In src/backend/commands/copyfrom.c : + if (resultRelInfo->ri_RelationDesc->rd_rel->relkind == RELKIND_FOREIGN_TABLE) There are a few steps of indirection. Adding assertion before the if statement on resultRelInfo->ri_RelationDesc, etc would help catch potential invalid pointer. +CopyToStart(CopyToState cstate) ... +CopyToFinish(CopyToState cstate) Since 'copy to' is the action, it would be easier to read the method names if they're called StartCopyTo, FinishCopyTo, respectively. That way, the method names would be consistent with existing ones, such as: extern uint64 DoCopyTo(CopyToState cstate); + * If a partition's root parent isn't allowed to use it, neither is the In the above sentence, 'it' refers to multi insert. It would be more readable to explicitly mention 'multi insert' instead of 'it' Cheers
Commits
-
Allow batch insertion during COPY into a foreign table.
- 97da48246d34 16.0 landed
-
postgres_fdw: Disable batch insertion when there are WCO constraints.
- 82593b9a3d5f 16.0 cited
-
Enforce foreign key correctly during cross-partition updates
- ba9a7e392171 15.0 cited
-
Fix permission checks on constraint violation errors on partitions.
- 6214e2b22804 14.0 cited
-
Fix compilation of uuid-ossp
- 525e60b74299 14.0 cited