Re: TRUNCATE on foreign table

From: Kazutaka Onishi <onishi(at)heterodb(dot)com>
To: Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>
Cc: Kohei KaiGai <kaigai(at)heterodb(dot)com>, Amit Langote <amitlangote09(at)gmail(dot)com>, Ibrar Ahmed <ibrar(dot)ahmad(at)gmail(dot)com>, Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>, Zhihong Yu <zyu(at)yugabyte(dot)com>, PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>
Subject: Re: TRUNCATE on foreign table
Date: 2021-04-03 00:53:57
Message-ID: CAJuF6cMuOijugFHYEEsmfQZJQOUjuBdGZkf6ADw3WXJ4anfT1w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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(dot)fujii(at)oss(dot)nttdata(dot)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

Attachment Content-Type Size
pgsql14-truncate-on-foreign-table.v7.patch application/octet-stream 41.9 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2021-04-03 01:02:29 Re: Have I found an interval arithmetic bug?
Previous Message Bryn Llewellyn 2021-04-03 00:50:59 Re: Have I found an interval arithmetic bug?