Re: [PATCH] Logical decoding of TRUNCATE

From: Petr Jelinek <petr(dot)jelinek(at)2ndquadrant(dot)com>
To: Marco Nenciarini <marco(dot)nenciarini(at)2ndquadrant(dot)it>, Simon Riggs <simon(at)2ndquadrant(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH] Logical decoding of TRUNCATE
Date: 2018-01-23 17:50:15
Message-ID: 35df4fd5-6b74-9c15-9246-ead8854cc669@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

Hi,

On 23/01/18 18:47, Marco Nenciarini wrote:
> Il 23/01/18 18:25, Petr Jelinek ha scritto:
>> On 23/01/18 18:19, Marco Nenciarini wrote:
>>> Il 23/01/18 18:13, Petr Jelinek ha scritto:
>>>> Hi,
>>>>
>>>> On 23/01/18 15:38, Marco Nenciarini wrote:
>>>>> Il 22/01/18 23:18, Petr Jelinek ha scritto:
>>>>>> On 22/01/18 19:45, Petr Jelinek wrote:
>>>>>>
>>>>>> Actually on second look, I don't like the new boolean parameter much.
>>>>>> I'd rather we didn't touch the input list and always close only
>>>>>> relations opened inside the ExecuteTruncateGuts().
>>>>>>
>>>>>> It may mean more list(s) but the current interface is still not clean.
>>>>>>
>>>>>
>>>>> Now ExecuteTruncateGuts unconditionally closes the relations that it
>>>>> opens. The caller has now always the responsibility to close the
>>>>> relations passed with the explicit_rels list.
>>>>
>>>> This looks good.
>>>>
>>>>>
>>>>> Version 15 attached.
>>>>>
>>>>
>>>> I see you still do CASCADE on the subscriber though.
>>>>
>>>
>>> No it doesn't. The following code in worker.c prevents that.
>>>
>>>
>>> + /*
>>> + * Even if we used CASCADE on the upstream master we explicitly
>>> + * default to replaying changes without further cascading.
>>> + * This might be later changeable with a user specified option.
>>> + */
>>> + cascade = false;
>>
>> Ah, that's pretty ugly, why don't we just use DROP_RESTRICT always
>> instead of this (keeping the comment). Unless you plan to make it option
>> as part of this patch, the current coding is confusing.
>>
>
> Ok, Removed.
>

Great, thanks, I think this is ready now so marking as such.

--
Petr Jelinek http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Martin Goodson 2018-01-23 18:04:41 Re: FW: Setting up streaming replication problems
Previous Message Marco Nenciarini 2018-01-23 17:47:16 Re: [PATCH] Logical decoding of TRUNCATE

Browse pgsql-hackers by date

  From Date Subject
Next Message Catalin Iacob 2018-01-23 18:13:56 Re: Doc tweak for huge_pages?
Previous Message Marco Nenciarini 2018-01-23 17:47:16 Re: [PATCH] Logical decoding of TRUNCATE