pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Fujii Masao <masao.fujii@oss.nttdata.com>
To: Michael Paquier <michael@paquier.xyz>
Cc: Kohei KaiGai <kaigai@heterodb.com>
Cc: Kazutaka Onishi <onishi@heterodb.com>
Cc: Amit Langote <amitlangote09@gmail.com>
Cc: Ibrar Ahmed <ibrar.ahmad@gmail.com>
Cc: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Cc: Zhihong Yu <zyu@yugabyte.com>
Cc: PostgreSQL Developers <pgsql-hackers@lists.postgresql.org>
Cc: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Subject: Re: TRUNCATE on foreign table
Date: Tue, 30 Mar 2021 02:54:17 +0900
Message-ID: <e03edf6f-d2d5-6067-bf46-d82e70c40cfb@oss.nttdata.com> (raw)
In-Reply-To: <YGFdxlYGCZ+Oe+Lz@paquier.xyz>
References: <CAExHW5uk+J61fVgcf+HYNZTuY9UnFnLhr34wMYU26mCtpf8i5w@mail.gmail.com>
	<CAJuF6cPwm13tnfRUAcy2CpncEvrGUOaJPuz4rWVFixL28zTA1g@mail.gmail.com>
	<CAExHW5tceUdJSYMy6R8uYzJ2upKfKdJdWPyUmM16-_xEdFGL0g@mail.gmail.com>
	<CALtqXTdRzbnDqYv-bA3N83+C6+=NkWa=R69sSk=-PZgHdBY0Bg@mail.gmail.com>
	<CA+HiwqFVecXnLUtTv6J2hTyEdkVtkTae3QNfOKRobu+L_1=9QA@mail.gmail.com>
	<CAJuF6cN4oU==vATJ7AgSqxCzV6X7j95O97LtKJcwddVcAcEx1w@mail.gmail.com>
	<CAJuF6cMxN=3myt3Uf3hhpwrXy4kFsDbdq9O_9NOJgNU5AB-AUw@mail.gmail.com>
	<66da56a4-ed5a-a18f-0f5e-b4d21cda71af@oss.nttdata.com>
	<CAOP8fzaJKnA9hK0Gtrgj+X1hCktqYqkyg3xY0eN=oaH=YuZBXQ@mail.gmail.com>
	<14cd2c16-8f95-e163-7797-db939b663ce5@oss.nttdata.com>
	<YGFdxlYGCZ+Oe+Lz@paquier.xyz>



On 2021/03/29 13:55, Michael Paquier wrote:
> On Mon, Mar 29, 2021 at 10:53:14AM +0900, Fujii Masao wrote:
>> I understand the motivation of this. But the other DMLs like UPDATE also
>> do the same thing for foreign tables? That is, when those DML commands
>> are executed on foreign tables, their changes are WAL-logged in a publisher side,
>> e.g., for logical replication? If not, it seems strange to allow only TRUNCATE
>> on foreign tables to be WAL-logged in a publisher side...
> 
> Executing DMLs on foreign tables does not generate any WAL AFAIK with
> the backend core code, even with wal_level = logical, as the DML is
> executed within the FDW callback (see just ExecUpdate() or
> ExecInsert() in nodeModifyTable.c), and foreign tables don't have an
> AM set as they have no physical storage.  A FDW may decide to generate
> some WAL records by itself though when doing the opeation, using the
> generic WAL interface but that's rather limited.
> 
> Generating WAL for the truncation of foreign tables sounds also like a
> strange concept to me.  I think that you should just make the patch
> work so as the truncation is passed down to the FDW that decides what
> it needs to do with it, and do nothing more than that.

Agreed.

Regards,

-- 
Fujii Masao
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION





view thread (117+ messages)  latest in thread

Message-ID: <e03edf6f-d2d5-6067-bf46-d82e70c40cfb@oss.nttdata.com>
Permalink:  ../e03edf6f-d2d5-6067-bf46-d82e70c40cfb@oss.nttdata.com/
Also on:    postgresql.org/message-id/e03edf6f-d2d5-6067-bf46-d82e70c40cfb@oss.nttdata.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: masao.fujii@oss.nttdata.com, michael@paquier.xyz, kaigai@heterodb.com, onishi@heterodb.com, amitlangote09@gmail.com, ibrar.ahmad@gmail.com, bharath.rupireddyforpostgres@gmail.com, zyu@yugabyte.com, ashutosh.bapat.oss@gmail.com
  Subject: Re: TRUNCATE on foreign table
  In-Reply-To: <e03edf6f-d2d5-6067-bf46-d82e70c40cfb@oss.nttdata.com>
  References: <CAExHW5uk+J61fVgcf+HYNZTuY9UnFnLhr34wMYU26mCtpf8i5w@mail.gmail.com> <CAJuF6cPwm13tnfRUAcy2CpncEvrGUOaJPuz4rWVFixL28zTA1g@mail.gmail.com> <CAExHW5tceUdJSYMy6R8uYzJ2upKfKdJdWPyUmM16-_xEdFGL0g@mail.gmail.com> <CALtqXTdRzbnDqYv-bA3N83+C6+=NkWa=R69sSk=-PZgHdBY0Bg@mail.gmail.com> <CA+HiwqFVecXnLUtTv6J2hTyEdkVtkTae3QNfOKRobu+L_1=9QA@mail.gmail.com> <CAJuF6cN4oU==vATJ7AgSqxCzV6X7j95O97LtKJcwddVcAcEx1w@mail.gmail.com> <CAJuF6cMxN=3myt3Uf3hhpwrXy4kFsDbdq9O_9NOJgNU5AB-AUw@mail.gmail.com> <66da56a4-ed5a-a18f-0f5e-b4d21cda71af@oss.nttdata.com> <CAOP8fzaJKnA9hK0Gtrgj+X1hCktqYqkyg3xY0eN=oaH=YuZBXQ@mail.gmail.com> <14cd2c16-8f95-e163-7797-db939b663ce5@oss.nttdata.com> <YGFdxlYGCZ+Oe+Lz@paquier.xyz> <e03edf6f-d2d5-6067-bf46-d82e70c40cfb@oss.nttdata.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox