pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Fujii Masao <masao.fujii@oss.nttdata.com>
To: 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: Mon, 29 Mar 2021 10:53:14 +0900
Message-ID: <14cd2c16-8f95-e163-7797-db939b663ce5@oss.nttdata.com> (raw)
In-Reply-To: <CAOP8fzaJKnA9hK0Gtrgj+X1hCktqYqkyg3xY0eN=oaH=YuZBXQ@mail.gmail.com>
References: <CAJuF6cMWDDqU-vn_knZgma+2GMaout68YUgn1uyDnexRhqqM5Q@mail.gmail.com>
	<CAExHW5uWU85myXdgO_okW=Ab3+JLXOO1hbAb_Y1rdRZo5q+tQg@mail.gmail.com>
	<CALj2ACUryBiJvdrEnghnygPaaniyobjZxzK96h-xwah9LWpX3w@mail.gmail.com>
	<CAExHW5sb6jFFB4MBw+fHkSs0pKzD6=Ux=08kfiPN1_gEh4QSKg@mail.gmail.com>
	<CAJuF6cNVJC5+C2ci0FCgJBpSX8NZF+eaMTbcboDRtTPyagUttA@mail.gmail.com>
	<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>



On 2021/03/29 9:31, Kohei KaiGai wrote:
> Fujii-san,
> 
>> XLOG_HEAP_TRUNCATE record is written even for the truncation of
>> a foreign table. Why is this necessary?
>>
> Foreign-tables are often used to access local data structure, like
> columnar data files
> on filesystem, not only remote accesses like postgres_fdw.
> In case when we want to implement logical replication on this kind of
> foreign-tables,
> truncate-command must be delivered to subscriber node - to truncate
> its local data.
> 
> In case of remote-access FDW drivers, truncate-command on the subscriber-side is
> probably waste of cycles, however, only FDW driver and DBA who configured the
> foreign-table know whether it is necessary, or not.
> 
> How about your opinions?

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...

Regards,

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





view thread (117+ messages)  latest in thread

Message-ID: <14cd2c16-8f95-e163-7797-db939b663ce5@oss.nttdata.com>
Permalink:  ../14cd2c16-8f95-e163-7797-db939b663ce5@oss.nttdata.com/
Also on:    postgresql.org/message-id/14cd2c16-8f95-e163-7797-db939b663ce5@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, 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: <14cd2c16-8f95-e163-7797-db939b663ce5@oss.nttdata.com>
  References: <CAJuF6cMWDDqU-vn_knZgma+2GMaout68YUgn1uyDnexRhqqM5Q@mail.gmail.com> <CALj2ACUryBiJvdrEnghnygPaaniyobjZxzK96h-xwah9LWpX3w@mail.gmail.com> <CAExHW5sb6jFFB4MBw+fHkSs0pKzD6=Ux=08kfiPN1_gEh4QSKg@mail.gmail.com> <CAJuF6cNVJC5+C2ci0FCgJBpSX8NZF+eaMTbcboDRtTPyagUttA@mail.gmail.com> <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>

* 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