Re: Ought to use heap_multi_insert() for pg_attribute/dependinsertions? - Mailing list pgsql-hackers

From Daniel Gustafsson
Subject Re: Ought to use heap_multi_insert() for pg_attribute/dependinsertions?
Date
Msg-id 9690D72F-5C4F-4016-9572-6D16684E1D87@yesql.se
Whole thread Raw
In response to Re: Ought to use heap_multi_insert() for pg_attribute/dependinsertions?  (Andres Freund <andres@anarazel.de>)
Responses Re: Ought to use heap_multi_insert() for pg_attribute/dependinsertions?  (Michael Paquier <michael@paquier.xyz>)
List pgsql-hackers
> On 25 Feb 2020, at 00:29, Andres Freund <andres@anarazel.de> wrote:
> On 2020-02-23 16:27:57 +0900, Michael Paquier wrote:

>> Good catch.  I would not backpatch that as it is not a live bug
>> because heap_multi_insert() is not used for catalogs yet.  With your
>> patch, that would be the case though..
>
> Thanks for pushing.

+1, thanks to the both of you for helping with the patch.  Attached is a v8 of
the patchset to make the cfbot happier, as the previous no longer applies.

In doing that I realized that there is another hunk in this patch for fixing up
logical decoding multi-insert support, which is independent of the patch in
question here so I split it off.  It's another issue which cause no harm at all
today, but fails as soon as someone tries to perform multi inserts into the
catalog.

AFAICT, the current coding assumes that the multi-insert isn't from a catalog,
and makes little attempts at surviving in case it is.  The attached patch fixes
that by taking a fast-path exit in case it is a catalog multi-insert, as there
is nothing to decode.

cheers ./daniel


Attachment

pgsql-hackers by date:

Previous
From: "Rémi Lapeyre"
Date:
Subject: [PATCH v1] Allow COPY "test" to output a header and add header matching mode to COPY FROM
Next
From: Tom Lane
Date:
Subject: Re: Resolving the python 2 -> python 3 mess