From: Fujii Masao <masao.fujii@oss.nttdata.com>
To: Justin Pryzby <pryzby@telsasoft.com>
Cc: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Cc: Kohei KaiGai <kaigai@heterodb.com>
Cc: Kazutaka Onishi <onishi@heterodb.com>
Cc: Zhihong Yu <zyu@yugabyte.com>
Cc: Amit Langote <amitlangote09@gmail.com>
Cc: Ibrar Ahmed <ibrar.ahmad@gmail.com>
Cc: PostgreSQL Developers <pgsql-hackers@lists.postgresql.org>
Cc: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Subject: Re: TRUNCATE on foreign table
Date: Fri, 23 Apr 2021 17:05:45 +0900
Message-ID: <d51c867e-ecf7-5da5-c5f8-b3cf532363ff@oss.nttdata.com> (raw)
In-Reply-To: <20210422085614.GA7256@telsasoft.com>
References: <CAOP8fzYbU2g4wFJAcxJkaESWV1NxJL3LYf=jXti-JL3fcvPgxw@mail.gmail.com>
<70310892-3572-f143-a692-e9aa4322a914@oss.nttdata.com>
<CALj2ACX7UYyg9tsqqS7akc5eSiwBLevM-ZfX00haFrdZrq2tgg@mail.gmail.com>
<a1975489-a32d-dc2b-c117-cd36495d82fa@oss.nttdata.com>
<CALj2ACUvkyyEP0YM5WPGfgXtTqYTMBE2Jzy8C1oX6_DcHTxf=g@mail.gmail.com>
<2ec345ad-9a7b-a21f-8a1b-04c0537ea9b8@oss.nttdata.com>
<CALj2ACUvuYrCi7G54Yov0oc_D9Zz6O157mtru72J-zxYYWf_3w@mail.gmail.com>
<94c99273-4b06-1b13-98da-a716e0454cac@oss.nttdata.com>
<CALj2ACVSCpLyzoCp10EpuvpbRwh2er56B4Dw42Gyp7EYdNxYew@mail.gmail.com>
<45bf0b95-b8e8-b1ee-015e-0cb4cf732def@oss.nttdata.com>
<20210422085614.GA7256@telsasoft.com>
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);
>> <para>
>> - <literal>behavior</literal> defines how foreign tables should
>> - be truncated, using as possible values <literal>DROP_RESTRICT</literal>,
>> - which means that <literal>RESTRICT</literal> option is specified,
>> - and <literal>DROP_CASCADE</literal>, which means that
>> - <literal>CASCADE</literal> option is specified, in
>> - <command>TRUNCATE</command> command.
>> + <literal>behavior</literal> is either <literal>DROP_RESTRICT</literal>
>> + or <literal>DROP_CASCADE</literal>, which indicates that the
>> + <literal>RESTRICT</literal> or <literal>CASCADE</literal> option was
>> + requested in the original <command>TRUNCATE</command> 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.
>
>> - <literal>restart_seqs</literal> is set to <literal>true</literal>
>> - if <literal>RESTART IDENTITY</literal> option is specified in
>> - <command>TRUNCATE</command> command. It is <literal>false</literal>
>> - if <literal>CONTINUE IDENTITY</literal> option is specified.
>> + If <literal>restart_seqs</literal> is <literal>true</literal>,
>> + the original <command>TRUNCATE</command> command requested the
>> + <literal>RESTART IDENTITY</literal> option, otherwise
>> + <literal>CONTINUE IDENTITY</literal> 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 ] <replaceable class="parameter">name</replaceable> [
>>
>> <para>
>> <command>TRUNCATE</command> can be used for foreign tables if
>> - the foreign data wrapper supports, for instance,
>> + supported by the foreign data wrapper, for instance,
>> see <xref linkend="postgres-fdw"/>.
>
> 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 <literal>CONTINUE IDENTITY</literal> option is specified.
>> </para>
>>
>> + <para>
>> + Note that information about <literal>ONLY</literal> options specified
>> + in the original <command>TRUNCATE</command> command is not passed to
>> + <function>ExecForeignTruncate</function>. This is the same behavior as
>> + for the callback functions for <command>SELECT</command>,
>> + <command>UPDATE</command> and <command>DELETE</command> 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.)
>> </para>
>>
>> + <para>
>> + Note that <literal>ONLY</literal> option specified in
>
> add "the" to say: "the ONLY"
Fixed.
>
>> + <command>SELECT</command>, <command>UPDATE</command>,
>> + <command>DELETE</command> or <command>TRUNCATE</command>
>> + 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
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, pryzby@telsasoft.com, bharath.rupireddyforpostgres@gmail.com, kaigai@heterodb.com, onishi@heterodb.com, zyu@yugabyte.com, amitlangote09@gmail.com, ibrar.ahmad@gmail.com, ashutosh.bapat.oss@gmail.com
Subject: Re: TRUNCATE on foreign table
In-Reply-To: <d51c867e-ecf7-5da5-c5f8-b3cf532363ff@oss.nttdata.com>
References: <CAOP8fzYbU2g4wFJAcxJkaESWV1NxJL3LYf=jXti-JL3fcvPgxw@mail.gmail.com> <70310892-3572-f143-a692-e9aa4322a914@oss.nttdata.com> <CALj2ACX7UYyg9tsqqS7akc5eSiwBLevM-ZfX00haFrdZrq2tgg@mail.gmail.com> <a1975489-a32d-dc2b-c117-cd36495d82fa@oss.nttdata.com> <CALj2ACUvkyyEP0YM5WPGfgXtTqYTMBE2Jzy8C1oX6_DcHTxf=g@mail.gmail.com> <2ec345ad-9a7b-a21f-8a1b-04c0537ea9b8@oss.nttdata.com> <CALj2ACUvuYrCi7G54Yov0oc_D9Zz6O157mtru72J-zxYYWf_3w@mail.gmail.com> <94c99273-4b06-1b13-98da-a716e0454cac@oss.nttdata.com> <CALj2ACVSCpLyzoCp10EpuvpbRwh2er56B4Dw42Gyp7EYdNxYew@mail.gmail.com> <45bf0b95-b8e8-b1ee-015e-0cb4cf732def@oss.nttdata.com> <20210422085614.GA7256@telsasoft.com> <d51c867e-ecf7-5da5-c5f8-b3cf532363ff@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