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: Michael Paquier <michael(at)paquier(dot)xyz>, 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>
Subject: Re: Ought to use heap_multi_insert() for pg_attribute/depend insertions?
Date: 2020-02-25 21:44:40
Message-ID: 9690D72F-5C4F-4016-9572-6D16684E1D87@yesql.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On 25 Feb 2020, at 00:29, Andres Freund <andres(at)anarazel(dot)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 Content-Type Size
catalog_multi_insert-v8.patch application/octet-stream 54.0 KB
decodemultiinsert_tupledata.patch application/octet-stream 4.2 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2020-02-25 22:06:03 Re: Resolving the python 2 -> python 3 mess
Previous Message Rémi Lapeyre 2020-02-25 21:38:32 [PATCH v1] Allow COPY "test" to output a header and add header matching mode to COPY FROM