Re: [PATCH] Logical decoding of TRUNCATE

Поиск
Список
Период
Сортировка
Искать
От
Simon Riggs
Тема
Re: [PATCH] Logical decoding of TRUNCATE
Дата
Msg-id
CANP8+jJzf-K0AnN2X=xpoaFq+Ncdjzbk6b4=JrMJoiMbgO39YQ@mail.gmail.com
Ответ на
Список
Дерево обсуждения
[PATCH] Logical decoding of TRUNCATE Marco Nenciarini <marco.nenciarini@2ndquadrant.it>
Re: [PATCH] Logical decoding of TRUNCATE Andres Freund <andres@anarazel.de>
Re: [PATCH] Logical decoding of TRUNCATE Simon Riggs <simon@2ndquadrant.com>
Re: [PATCH] Logical decoding of TRUNCATE Marco Nenciarini <marco.nenciarini@2ndquadrant.it>
Re: [PATCH] Logical decoding of TRUNCATE Marco Nenciarini <marco.nenciarini@2ndquadrant.it>
Re: [PATCH] Logical decoding of TRUNCATE Marco Nenciarini <marco.nenciarini@2ndquadrant.it>
Re: [PATCH] Logical decoding of TRUNCATE Marco Nenciarini <marco.nenciarini@2ndquadrant.it>
Re: [PATCH] Logical decoding of TRUNCATE Petr Jelinek <petr.jelinek@2ndquadrant.com>
Re: [PATCH] Logical decoding of TRUNCATE Robert Haas <robertmhaas@gmail.com>
Re: [PATCH] Logical decoding of TRUNCATE Petr Jelinek <petr.jelinek@2ndquadrant.com>
Re: [PATCH] Logical decoding of TRUNCATE Robert Haas <robertmhaas@gmail.com>
Re: [PATCH] Logical decoding of TRUNCATE Simon Riggs <simon@2ndquadrant.com>
Re: [PATCH] Logical decoding of TRUNCATE Marco Nenciarini <marco.nenciarini@2ndquadrant.it>
Re: [PATCH] Logical decoding of TRUNCATE Petr Jelinek <petr.jelinek@2ndquadrant.com>
Re: [PATCH] Logical decoding of TRUNCATE Petr Jelinek <petr.jelinek@2ndquadrant.com>
Re: [PATCH] Logical decoding of TRUNCATE Marco Nenciarini <marco.nenciarini@2ndquadrant.it>
Re: [PATCH] Logical decoding of TRUNCATE Petr Jelinek <petr.jelinek@2ndquadrant.com>
Re: [PATCH] Logical decoding of TRUNCATE Marco Nenciarini <marco.nenciarini@2ndquadrant.it>
Re: [PATCH] Logical decoding of TRUNCATE Petr Jelinek <petr.jelinek@2ndquadrant.com>
Re: [PATCH] Logical decoding of TRUNCATE Marco Nenciarini <marco.nenciarini@2ndquadrant.it>
Re: [PATCH] Logical decoding of TRUNCATE Petr Jelinek <petr.jelinek@2ndquadrant.com>
Re: [PATCH] Logical decoding of TRUNCATE Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Re: [PATCH] Logical decoding of TRUNCATE Petr Jelinek <petr.jelinek@2ndquadrant.com>
Re: [PATCH] Logical decoding of TRUNCATE Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Re: [PATCH] Logical decoding of TRUNCATE Petr Jelinek <petr.jelinek@2ndquadrant.com>
Re: [PATCH] Logical decoding of TRUNCATE Thomas Munro <thomas.munro@enterprisedb.com>
Re: [PATCH] Logical decoding of TRUNCATE Petr Jelinek <petr.jelinek@2ndquadrant.com>
Re: [PATCH] Logical decoding of TRUNCATE Marco Nenciarini <marco.nenciarini@2ndquadrant.it>
Re: [PATCH] Logical decoding of TRUNCATE Andres Freund <andres@anarazel.de>
Re: [PATCH] Logical decoding of TRUNCATE Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Re: [PATCH] Logical decoding of TRUNCATE Andres Freund <andres@anarazel.de>
Re: [PATCH] Logical decoding of TRUNCATE Simon Riggs <simon@2ndquadrant.com>
Re: [PATCH] Logical decoding of TRUNCATE Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Re: [PATCH] Logical decoding of TRUNCATE Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Re: [PATCH] Logical decoding of TRUNCATE Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: [PATCH] Logical decoding of TRUNCATE Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Re: [PATCH] Logical decoding of TRUNCATE Noah Misch <noah@leadboat.com>
Re: [PATCH] Logical decoding of TRUNCATE Andres Freund <andres@anarazel.de>
Re: [PATCH] Logical decoding of TRUNCATE Peter Geoghegan <pg@bowt.ie>
Re: [PATCH] Logical decoding of TRUNCATE Andres Freund <andres@anarazel.de>
Re: [PATCH] Logical decoding of TRUNCATE Noah Misch <noah@leadboat.com>
Re: [PATCH] Logical decoding of TRUNCATE Amit Kapila <amit.kapila16@gmail.com>
Re: [PATCH] Logical decoding of TRUNCATE Noah Misch <noah@leadboat.com>
Re: [PATCH] Logical decoding of TRUNCATE Simon Riggs <simon@2ndquadrant.com>
Re: [PATCH] Logical decoding of TRUNCATE Simon Riggs <simon@2ndquadrant.com>
Re: [PATCH] Logical decoding of TRUNCATE Andres Freund <andres@anarazel.de>
Re: [PATCH] Logical decoding of TRUNCATE Christophe Pettus <xof@thebuild.com>
Logical decoding of TRUNCATE vs DELETE Jeremy Schneider <schnjere@amazon.com>
Re: [PATCH] Logical decoding of TRUNCATE Marco Nenciarini <marco.nenciarini@2ndquadrant.it>
On 17 January 2018 at 17:07, Petr Jelinek  wrote:

> Things I am less convinced about:
>
> The patch will cascade truncation on downstream if cascade was specified
> on the upstream, that can potentially be dangerous and we either should
> not do it and only truncate the tables which were truncated upstream
> (but without restricting because of FKs), leaving the data inconsistent
> on downstream (like we do already with DELETE or UPDATE). Or maybe make
> it into either subscription or publication option so that user can chose
> the behaviour here as I am sure some people will want it to cascade (but
> the default should still IMHO be to not cascade as that's safer).

I agree the default should be to NOT cascade.

If someone wants cascading as a publication option, that can be added later.

>> +     /* logicalrep_rel_close call not needed, because ExecuteTruncateGuts
>> +      * already closes the relations. Setting localrel to NULL in the map entry
>> +      * is still needed.
>> +      */
>> +     rel->localrel = NULL;
>
> This is somewhat ugly. Perhaps the ExecuteTruncateGuts should track
> which relations it opened and only close those and the rest should be
> closed by caller? That should also remove the other ugly part which is
> that the ExecuteTruncateGuts modifies the input list. What if caller
> wanted to use those relations it sent as parameter later?

Agreed

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

В списке pgsql-hackers по дате отправления
От: Simon Riggs
Дата:
От: Tom Lane
Дата:
FAQ