Re: Ought to use heap_multi_insert() for pg_attribute/depend insertions?

From: Daniel Gustafsson <daniel(at)yesql(dot)se>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>, Thomas Munro <thomas(dot)munro(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Michael Paquier <michael(at)paquier(dot)xyz>
Subject: Re: Ought to use heap_multi_insert() for pg_attribute/depend insertions?
Date: 2020-02-22 21:22:27
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

> On 26 Jan 2020, at 21:30, Andres Freund <andres(at)anarazel(dot)de> wrote:
> On 2020-01-22 23:18:12 +0100, Daniel Gustafsson wrote:
>>> On 26 Nov 2019, at 06:44, Michael Paquier <michael(at)paquier(dot)xyz> wrote:
>> Re this patch being in WoA state for some time [0]:
>>> The regression tests of contrib/test_decoding are still failing here:
>>> +ERROR: could not resolve cmin/cmax of catalog tuple
>> This is the main thing left with this patch, and I've been unable so far to
>> figure it out. I have an unscientific hunch that this patch is shaking out
>> something (previously unexercised) in the logical decoding code supporting
>> multi-inserts in the catalog. If anyone has ideas or insights, I would love
>> the help.
> Perhaps we can take a look at it together while at fosdem? Feel free to
> remind me...

Which we did, and after that I realized I had been looking at it from the wrong
angle. Returning to it after coming home from FOSDEM I believe I have found
the culprit.

Turns out that we in heap_multi_insert missed to call log_heap_new_cid for the
first tuple inserted, we only do it in the loop body for the subsequent ones.
With the attached patch, the v6 of this patch posted upthead pass the tests for
me. I have a v7 brewing which I'll submit shortly, but since this fix
unrelated to that patchseries other than as a pre-requisite I figured I'd post
that separately.

cheers ./daniel

Attachment Content-Type Size
heap_multi_insert_cid.patch application/octet-stream 985 bytes

In response to


Browse pgsql-hackers by date

  From Date Subject
Next Message Tomas Vondra 2020-02-22 21:53:35 Re: explain HashAggregate to report bucket and memory stats
Previous Message Michail Nikolaev 2020-02-22 20:08:45 Re: BUG #16108: Colorization to the output of command-line has unproperly behaviors at Windows platform