Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lZqp3-0004gt-B4 for pgsql-hackers@arkaria.postgresql.org; Fri, 23 Apr 2021 08:05:57 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lZqoz-0003Qf-5K for pgsql-hackers@arkaria.postgresql.org; Fri, 23 Apr 2021 08:05:53 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lZqoy-0003QX-V7 for pgsql-hackers@lists.postgresql.org; Fri, 23 Apr 2021 08:05:52 +0000 Received: from oss.nttdata.com ([49.212.34.109]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lZqov-0004iN-Ky for pgsql-hackers@lists.postgresql.org; Fri, 23 Apr 2021 08:05:51 +0000 Received: from hnk.local (p2043043-ipbf1801funabasi.chiba.ocn.ne.jp [221.185.194.43]) by oss.nttdata.com (Postfix) with ESMTPSA id C57856026E; Fri, 23 Apr 2021 17:05:45 +0900 (JST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.102.3 at oss.nttdata.com Subject: Re: TRUNCATE on foreign table To: Justin Pryzby Cc: Bharath Rupireddy , Kohei KaiGai , Kazutaka Onishi , Zhihong Yu , Amit Langote , Ibrar Ahmed , PostgreSQL Developers , Ashutosh Bapat References: <70310892-3572-f143-a692-e9aa4322a914@oss.nttdata.com> <2ec345ad-9a7b-a21f-8a1b-04c0537ea9b8@oss.nttdata.com> <94c99273-4b06-1b13-98da-a716e0454cac@oss.nttdata.com> <45bf0b95-b8e8-b1ee-015e-0cb4cf732def@oss.nttdata.com> <20210422085614.GA7256@telsasoft.com> From: Fujii Masao Message-ID: Date: Fri, 23 Apr 2021 17:05:45 +0900 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0) Gecko/20100101 Thunderbird/78.10.0 MIME-Version: 1.0 In-Reply-To: <20210422085614.GA7256@telsasoft.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2021/04/22 17:56, Justin Pryzby wrote: > On Thu, Apr 22, 2021 at 03:36:25PM +0900, Fujii Masao wrote: >> diff --git a/doc/src/sgml/fdwhandler.sgml b/doc/src/sgml/fdwhandler.sgml >> index 553524553b..69aa66e73e 100644 >> --- a/doc/src/sgml/fdwhandler.sgml >> +++ b/doc/src/sgml/fdwhandler.sgml >> @@ -1076,27 +1076,25 @@ ExecForeignTruncate(List *rels, >> bool restart_seqs); >> >> - behavior defines how foreign tables should >> - be truncated, using as possible values DROP_RESTRICT, >> - which means that RESTRICT option is specified, >> - and DROP_CASCADE, which means that >> - CASCADE option is specified, in >> - TRUNCATE command. >> + behavior is either DROP_RESTRICT >> + or DROP_CASCADE, which indicates that the >> + RESTRICT or CASCADE option was >> + requested in the original TRUNCATE command, >> + respectively. > > Now that I reread this, I would change "which indicates" to "indicating". Fixed. Thanks for reviewing the patch! I will post the updated version of the patch later. > >> - restart_seqs is set to true >> - if RESTART IDENTITY option is specified in >> - TRUNCATE command. It is false >> - if CONTINUE IDENTITY option is specified. >> + If restart_seqs is true, >> + the original TRUNCATE command requested the >> + RESTART IDENTITY option, otherwise >> + CONTINUE IDENTITY option. > > should it say "specified" instead of requested ? > Or should it say "requested the RESTART IDENTITY behavior" ? > > Also, I think it should say "..otherwise, the CONTINUE IDENTITY behavior was > requested". Fixed. >> +++ b/doc/src/sgml/ref/truncate.sgml >> @@ -173,7 +173,7 @@ TRUNCATE [ TABLE ] [ ONLY ] name [ >> >> >> TRUNCATE can be used for foreign tables if >> - the foreign data wrapper supports, for instance, >> + supported by the foreign data wrapper, for instance, >> see . > > what does "for instance" mean here? I think it should be removed. Removed. > >> +++ b/doc/src/sgml/fdwhandler.sgml >> @@ -1111,6 +1099,15 @@ ExecForeignTruncate(List *rels, List *rels_extra, >> if CONTINUE IDENTITY option is specified. >> >> >> + >> + Note that information about ONLY options specified >> + in the original TRUNCATE command is not passed to >> + ExecForeignTruncate. This is the same behavior as >> + for the callback functions for SELECT, >> + UPDATE and DELETE on > > There's an extra space before DELETE Fixed. > >> diff --git a/doc/src/sgml/postgres-fdw.sgml b/doc/src/sgml/postgres-fdw.sgml >> index 5320accf6f..d03731b7d4 100644 >> --- a/doc/src/sgml/postgres-fdw.sgml >> +++ b/doc/src/sgml/postgres-fdw.sgml >> @@ -69,6 +69,13 @@ >> have privileges to do these things.) >> >> >> + >> + Note that ONLY option specified in > > add "the" to say: "the ONLY" Fixed. > >> + SELECT, UPDATE, >> + DELETE or TRUNCATE >> + has no effect when accessing or modifyung the remote table. > > modifying Fixed. Regards, -- Fujii Masao Advanced Computing Technology Center Research and Development Headquarters NTT DATA CORPORATION