Re: TRUNCATE on foreign tables

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Kohei KaiGai <kaigai(at)heterodb(dot)com>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: TRUNCATE on foreign tables
Date: 2020-01-02 03:16:54
Message-ID: 20200102031654.GA11441@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2020-01-02 03:33:38 Re: [HACKERS] Block level parallel vacuum
Previous Message Masahiko Sawada 2020-01-02 02:58:49 Re: [HACKERS] Block level parallel vacuum