Re: TRUNCATE on foreign table
Kazutaka Onishi <onishi@heterodb.com>
From: Kazutaka Onishi <onishi@heterodb.com>
To: Fujii Masao <masao.fujii@oss.nttdata.com>
Cc: Kohei KaiGai <kaigai@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-03T00:53:57Z
Lists: pgsql-hackers
Attachments
- pgsql14-truncate-on-foreign-table.v7.patch (application/octet-stream) patch v7
All, Thank you for discussion. I've updated the patch (v6->v7) according to the conclusion. I'll show the modified points: 1. Comments for ExecuteTuncate() 2. Replacing extra value in frels_extra with integer to label. 3. Skipping XLOG_HEAP_TRUNCATE on foreign table Regards, 2021年4月2日(金) 11:44 Fujii Masao <masao.fujii@oss.nttdata.com>: > > > > 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
-
doc: Review for "Allow TRUNCATE command to truncate foreign tables".
- 0c8f40863acb 14.0 landed
-
Don't pass "ONLY" options specified in TRUNCATE to foreign data wrapper.
- 8e9ea08bae93 14.0 landed
-
Support tab-complete for TRUNCATE on foreign tables.
- 81e094bdfdd6 14.0 landed
-
Allow TRUNCATE command to truncate foreign tables.
- 8ff1c94649f5 14.0 landed
-
Add support for asynchronous execution.
- 27e1f14563cf 14.0 cited