Re: TRUNCATE on foreign tables - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: TRUNCATE on foreign tables
Date
Msg-id 20200102031654.GA11441@alvherre.pgsql
Whole thread Raw
In response to Re: TRUNCATE on foreign tables  (Kohei KaiGai <kaigai@heterodb.com>)
Responses Re: TRUNCATE on foreign tables  (Kohei KaiGai <kaigai@heterodb.com>)
List pgsql-hackers
On 2020-Jan-01, Kohei KaiGai wrote:

> Hello,
> 
> The attached patch adds TRUNCATE support on foreign table.
> 
> This patch adds an optional callback ExecForeignTruncate(Relation rel)
> to FdwRoutine.
> It is invoked during ExecuteTruncateGuts, then FDW driver hands over
> the jobs related to complete "truncate on the foreign table".

I think this would need to preserve the notion of multi-table truncates.
Otherwise it won't be possible to truncate tables linked by FKs.  I
think this means the new entrypoint needs to receive a list of rels to
truncate, not just one.  (Maybe an alternative is to make it "please
truncate rel X, and be aware that relations Y,Z are also being
truncated at the same time".)

Looking at apache arrow documentation, it doesn't appear that it has
anything like FK constraints.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



pgsql-hackers by date:

Previous
From: Masahiko Sawada
Date:
Subject: Re: [HACKERS] Block level parallel vacuum
Next
From: Amit Kapila
Date:
Subject: Re: [HACKERS] Block level parallel vacuum