Re: [PATCH] Logical decoding of TRUNCATE

Поиск
Список
Период
Сортировка
От Simon Riggs
Тема Re: [PATCH] Logical decoding of TRUNCATE
Дата
Msg-id CANP8+jLMet1MHkYP2no9Wrn5RCiCJvFsF+ie-YUDk2nfXCnjRw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [PATCH] Logical decoding of TRUNCATE  (Andres Freund <andres@anarazel.de>)
Ответы Re: [PATCH] Logical decoding of TRUNCATE  (Andres Freund <andres@anarazel.de>)
Список pgsql-hackers
On 1 April 2018 at 21:01, Andres Freund <andres@anarazel.de> wrote:

>> ***************
>> *** 111,116 **** CREATE PUBLICATION <replaceable class="parameter">name</replaceable>
>> --- 111,121 ----
>>             and so the default value for this option is
>>             <literal>'insert, update, delete'</literal>.
>>            </para>
>> +          <para>
>> +            <command>TRUNCATE</command> is treated as a form of
>> +            <command>DELETE</command> for the purpose of deciding whether
>> +            to publish, or not.
>> +          </para>
>>           </listitem>
>>          </varlistentry>
>>         </variablelist>
>
> Why is this a good idea?

TRUNCATE removes rows, just as DELETE does, so anybody that wants to
publish the removal of rows will be interested in this.

This avoids unnecessary overcomplication of the existing interface.

>> +      * Write a WAL record to allow this set of actions to be logically decoded.
>> +      * We could optimize this away when !RelationIsLogicallyLogged(rel)
>> +      * but that doesn't save much space or time.
>
> What you're saying isn't that you're not logging anything, but that
> you're allocating the header regardless? Because this certainly sounds
> like you unconditionally log a WAL record.

It says that, yes, my idea - as explained.

-- 
Simon Riggs                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


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

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: PATCH: Configurable file mode mask
Следующее
От: Arthur Zakirov
Дата:
Сообщение: Re: json(b)_to_tsvector with numeric values