Re: TRUNCATE on foreign table

Поиск
Список
Период
Сортировка
От Fujii Masao
Тема Re: TRUNCATE on foreign table
Дата
Msg-id 45bf0b95-b8e8-b1ee-015e-0cb4cf732def@oss.nttdata.com
обсуждение исходный текст
Ответ на Re: TRUNCATE on foreign table  (Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>)
Ответы Re: TRUNCATE on foreign table
Re: TRUNCATE on foreign table
Список pgsql-hackers

On 2021/04/22 9:39, Bharath Rupireddy wrote:
> One comment on truncate_foreign_table_docs_v1.patch:
> 1) I think it is "to be truncated"
> +     <literal>rels</literal> is a list of <structname>Relation</structname>
> +     data structures for each foreign table to truncated.

Fixed. Thanks!

> How about a slightly changed phrasing like below?
> +     <literal>rels</literal> is a list of <structname>Relation</structname>
> +     data structures of foreign tables to truncate.
Either works at least for me. If you think that this phrasing is
more precise or better, I'm ok with that and will update the patch again.


> Other than above, the patch LGTM.
> 
>>> 3) How about adding an extra para(after below para in
>>> postgres_fdw.sgml) on WHY we don't push "ONLY" to foreign tables while
>>> truncating? We could add to the same para for other options if at all
>>> we don't choose to push them.
>>>     <command>DELETE</command>, or <command>TRUNCATE</command>.
>>>     (Of course, the remote user you have specified in your user mapping must
>>>     have privileges to do these things.)
>>
>> I agree to document the behavior that ONLY option is always ignored
>> for foreign tables. But I'm not sure if we can document WHY.
>> Because I could not find the past discussion about why ONLY option is
>> ignored on SELECT, etc... Maybe it's enough to document the behavior?
> 
> +1 to specify in the documentation about ONLY option is always
> ignored.

Added.


> But can we specify the WHY part within deparseTruncateSql, it
> will be there for developer reference? I feel it's better if this
> change goes with truncate_foreign_table_dont_pass_only_clause_v2.patch

I added this information into fdwhandler.sgml because the developers
usually read fdwhandler.sgml.


>>> 4) Isn't it better to mention the "ONLY" option is not pushed to remote
>>> -- truncate with ONLY clause
>>> TRUNCATE ONLY tru_ftable_parent;
>>>
>>> TRUNCATE ONLY tru_ftable;        -- truncate both parent and child
>>> SELECT count(*) FROM tru_ftable;   -- 0

I added the comment.


Could you review the attached patches?

Regards,

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

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Dilip Kumar
Дата:
Сообщение: Re: PageGetItemIdCareful - should we MAXALIGN sizeof(BTPageOpaqueData)?
Следующее
От: "tsunakawa.takay@fujitsu.com"
Дата:
Сообщение: RE: [bug?] Missed parallel safety checks, and wrong parallel safety