Re: TRUNCATE on foreign table

Fujii Masao <masao.fujii@oss.nttdata.com>

From: Fujii Masao <masao.fujii@oss.nttdata.com>
To: Kohei KaiGai <kaigai@heterodb.com>
Cc: Kazutaka Onishi <onishi@heterodb.com>, Amit Langote <amitlangote09@gmail.com>, Ibrar Ahmed <ibrar.ahmad@gmail.com>, Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>, Zhihong Yu <zyu@yugabyte.com>, PostgreSQL Developers <pgsql-hackers@lists.postgresql.org>, Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Date: 2021-04-02T02:43:58Z
Lists: pgsql-hackers

On 2021/04/02 9:37, Kohei KaiGai wrote:
> It is fair enough for me to reverse the order of actual truncation.
> 
> How about the updated comments below?
> 
>      This is a multi-relation truncate.  We first open and grab exclusive
>      lock on all relations involved, checking permissions (local database
>      ACLs even if relations are foreign-tables) and otherwise verifying
>      that the relation is OK for truncation. In CASCADE mode, ...(snip)...
>      Finally all the relations are truncated and reindexed. If any foreign-
>      tables are involved, its callback shall be invoked prior to the truncation
>      of regular tables.

LGTM.


>> BTW, the latest patch doesn't seem to be applied cleanly to the master
>> because of commit 27e1f14563. Could you rebase it?
>>
> Onishi-san, go ahead. :-)

+1

Regards,

-- 
Fujii Masao
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION



Commits

  1. doc: Review for "Allow TRUNCATE command to truncate foreign tables".

  2. Don't pass "ONLY" options specified in TRUNCATE to foreign data wrapper.

  3. Support tab-complete for TRUNCATE on foreign tables.

  4. Allow TRUNCATE command to truncate foreign tables.

  5. Add support for asynchronous execution.