On 1 April 2018 at 21:01, Andres Freund <and...@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

Reply via email to