Re: TRUNCATE on foreign table
Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
From: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
To: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Cc: Kazutaka Onishi <onishi@heterodb.com>, Zhihong Yu <zyu@yugabyte.com>, PostgreSQL Developers <pgsql-hackers@lists.postgresql.org>,
Kohei KaiGai <kaigai@heterodb.com>
Date: 2021-02-09T12:30:27Z
Lists: pgsql-hackers
On Tue, Feb 9, 2021 at 5:49 PM Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com> wrote: > > On Tue, Feb 9, 2021 at 5:31 PM Ashutosh Bapat > <ashutosh.bapat.oss@gmail.com> wrote: > > Why would one want to truncate a foreign table instead of truncating > > actual table wherever it is? > > I think when the deletion on foreign tables (which actually deletes > rows from the remote table?) is allowed, it does make sense to have a > way to truncate the remote table via foreign table. Also, it can avoid > going to each and every remote server and doing the truncation > instead. DELETE is very different from TRUNCATE. Application may want to DELETE based on a join with a local table and hence it can not be executed on a foreign server. That's not true with TRUNCATE. -- Best Wishes, Ashutosh Bapat
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