Re: postgres_fdw: Use COPY to speed up batch inserts - Mailing list pgsql-hackers

From jian he
Subject Re: postgres_fdw: Use COPY to speed up batch inserts
Date
Msg-id CACJufxGgnX91Kzp-kJ03uZp2-sAPtuOpxxjhcigN72Z7BcYRZA@mail.gmail.com
Whole thread Raw
In response to Re: postgres_fdw: Use COPY to speed up batch inserts  ("Matheus Alcantara" <matheusssilv97@gmail.com>)
List pgsql-hackers
On Thu, Oct 23, 2025 at 8:01 AM Matheus Alcantara
<matheusssilv97@gmail.com> wrote:
>
> Please see the attached v3 version that implements this idea.
>
hi.

I am not famailith with this module.
some of the foreach can be replaced with foreach_int.

I suspect that somewhere Form_pg_attribute.attisdropped is not handled properly.
the following setup will crash.

---source database
drop table batch_table1;
create table batch_table1(x int);

---foreign table database
drop foreign table if exists ftable1;
CREATE FOREIGN TABLE ftable1 ( x int ) SERVER loopback1 OPTIONS (
table_name 'batch_table1', batch_size '10' );
ALTER FOREIGN TABLE ftable1 DROP COLUMN x;
ALTER FOREIGN TABLE ftable1 add COLUMN x int;

INSERT INTO ftable SELECT * FROM generate_series(1, 10) i; --- this
will cause server crash.



pgsql-hackers by date:

Previous
From: Oleg Tselebrovskiy
Date:
Subject: 001_password.pl fails with --without-readline
Next
From: Aleksander Alekseev
Date:
Subject: Re: Add uuid_to_base32hex() and base32hex_to_uuid() built-in functions