Re: [PATCH] Logical decoding of TRUNCATE - Mailing list pgsql-hackers

From Petr Jelinek
Subject Re: [PATCH] Logical decoding of TRUNCATE
Date
Msg-id f6352c33-f3e3-0e35-dbd2-29949b9c2b59@2ndquadrant.com
Whole thread Raw
In response to Re: [PATCH] Logical decoding of TRUNCATE  (Petr Jelinek <petr.jelinek@2ndquadrant.com>)
Responses Re: [PATCH] Logical decoding of TRUNCATE
List pgsql-hackers
On 22/01/18 19:45, Petr Jelinek wrote:
> On 19/01/18 12:37, Marco Nenciarini wrote:
>> Hi All,
>>>>> +     /* 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
>>>
>>
>> Attached a new version of the patch addressing these issues.
>>
> 
> Besides the small thing I wrote for the 0001 in the other thread I am
> pretty much happy with this now.
> 

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.

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


pgsql-hackers by date:

Previous
From: Stephen Frost
Date:
Subject: Re: [HACKERS] PoC plpgsql - possibility to force custom or genericplan
Next
From: Dmitry Dolgov
Date:
Subject: Re: [HACKERS] [PATCH] Generic type subscripting