RE: [POC] Fast COPY FROM command for the table with foreign partitions

tsunakawa.takay@fujitsu.com <tsunakawa.takay@fujitsu.com>

From: "tsunakawa.takay@fujitsu.com" <tsunakawa.takay@fujitsu.com>
To: 'Justin Pryzby' <pryzby@telsasoft.com>
Cc: 'Andrey Lepikhov' <a.lepikhov@postgrespro.ru>, "tanghy.fnst@cn.fujitsu.com" <tanghy.fnst@cn.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-Dev <pgsql-hackers@postgresql.org>, Tomas Vondra <tomas.vondra@enterprisedb.com>, "houzj.fnst@cn.fujitsu.com" <houzj.fnst@cn.fujitsu.com>, Amit Langote <amitlangote09@gmail.com>
Date: 2021-02-15T04:54:00Z
Lists: pgsql-hackers

Attachments

From: Justin Pryzby <pryzby@telsasoft.com>
> This is crashing during fdw check.
> http://cfbot.cputube.org/andrey-lepikhov.html
> 
> Maybe it's related to this patch:
> |commit 6214e2b2280462cbc3aa1986e350e167651b3905
> |    Fix permission checks on constraint violation errors on partitions.
> |    Security: CVE-2021-3393

Thank you for your kind detailed investigation.  The rebased version is attached.


Regards
Takayuki Tsunakawa


Commits

  1. Allow batch insertion during COPY into a foreign table.

  2. postgres_fdw: Disable batch insertion when there are WCO constraints.

  3. Enforce foreign key correctly during cross-partition updates

  4. Fix permission checks on constraint violation errors on partitions.

  5. Fix compilation of uuid-ossp