Re: Fast COPY FROM based on batch insert - Mailing list pgsql-hackers

From Andrey Lepikhov
Subject Re: Fast COPY FROM based on batch insert
Date
Msg-id b3a60e56-4d33-c2cb-3708-f234392be3a4@postgrespro.ru
Whole thread Raw
In response to Re: Fast COPY FROM based on batch insert  (Ian Barwick <ian.barwick@enterprisedb.com>)
Responses Re: Fast COPY FROM based on batch insert
List pgsql-hackers
On 8/7/2022 05:12, Ian Barwick wrote:
>      ERROR:  bind message supplies 0 parameters, but prepared statement 
> "pgsql_fdw_prep_178" requires 6
>      CONTEXT:  remote SQL command: INSERT INTO public.foo_part_1(t, v1, 
> v2, v3, v4, v5) VALUES ($1, $2, $3, $4, $5, $6)
>      COPY foo, line 88160
Thanks, I got it. MultiInsertBuffer are created on the first non-zero 
flush of tuples into the partition and isn't deleted from the buffers 
list until the end of COPY. And on a subsequent flush in the case of 
empty buffer we catch the error.
Your fix is correct, but I want to propose slightly different change 
(see in attachment).

-- 
regards,
Andrey Lepikhov
Postgres Professional
Attachment

pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: [PATCH] fix wait_event of pg_stat_activity in case of high amount of connections
Next
From: Jingtang Zhang
Date:
Subject: Two successive tabs in test case are causing syntax error in psql