postgresql/contrib
Etsuro Fujita 97da48246d Allow batch insertion during COPY into a foreign table.
Commit 3d956d956 allowed the COPY, but it's done by inserting individual
rows to the foreign table, so it can be inefficient due to the overhead
caused by each round-trip to the foreign server.  To improve performance
of the COPY in such a case, this patch allows batch insertion, by
extending the multi-insert machinery in CopyFrom() to the foreign-table
case so that we insert multiple rows to the foreign table at once using
the FDW callback routine added by commit b663a4136.  This patch also
allows this for postgres_fdw.  It is enabled by the "batch_size" option
added by commit b663a4136, which is disabled by default.

When doing batch insertion, we update progress of the COPY command after
performing the FDW callback routine, to count rows not suppressed by the
FDW as well as a BEFORE ROW INSERT trigger.  For consistency, this patch
changes the timing of updating it for plain tables: previously, we
updated it immediately after adding each row to the multi-insert buffer,
but we do so only after writing the rows stored in the buffer out to the
table using table_multi_insert(), which I think would be consistent even
with non-batching mode, because in that mode we update it after writing
each row out to the table using table_tuple_insert().

Andrey Lepikhov, heavily revised by me, with review from Ian Barwick,
Andrey Lepikhov, and Zhihong Yu.

Discussion: https://postgr.es/m/bc489202-9855-7550-d64c-ad2d83c24867%40postgrespro.ru
2022-10-13 18:45:00 +09:00
..
adminpack tests: Rename conflicting role names 2022-10-05 10:43:13 -07:00
amcheck Simplify our Assert infrastructure a little. 2022-10-10 15:16:56 -04:00
auth_delay meson: Add windows resource files 2022-10-05 09:56:05 -07:00
auto_explain meson: Add windows resource files 2022-10-05 09:56:05 -07:00
basebackup_to_shell meson: Add windows resource files 2022-10-05 09:56:05 -07:00
basic_archive meson: Add windows resource files 2022-10-05 09:56:05 -07:00
bloom meson: Add support for building with precompiled headers 2022-10-06 17:19:30 -07:00
bool_plperl meson: Add windows resource files 2022-10-05 09:56:05 -07:00
btree_gin meson: Add windows resource files 2022-10-05 09:56:05 -07:00
btree_gist Use C library functions instead of Abs() for int64 2022-10-10 09:01:17 +02:00
citext meson: Add windows resource files 2022-10-05 09:56:05 -07:00
cube Remove unnecessary uses of Abs() 2022-10-07 13:29:33 +02:00
dblink meson: Add windows resource files 2022-10-05 09:56:05 -07:00
dict_int meson: Add windows resource files 2022-10-05 09:56:05 -07:00
dict_xsyn meson: Add windows resource files 2022-10-05 09:56:05 -07:00
earthdistance meson: Add windows resource files 2022-10-05 09:56:05 -07:00
file_fdw Fix final warnings produced by -Wshadow=compatible-local 2022-10-07 13:13:27 +13:00
fuzzystrmatch meson: Add windows resource files 2022-10-05 09:56:05 -07:00
hstore meson: Add support for building with precompiled headers 2022-10-06 17:19:30 -07:00
hstore_plperl meson: Add windows resource files 2022-10-05 09:56:05 -07:00
hstore_plpython meson: Add windows resource files 2022-10-05 09:56:05 -07:00
intagg meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
intarray Use fabsf() instead of Abs() or fabs() where appropriate 2022-10-08 13:43:26 +02:00
isn meson: Add windows resource files 2022-10-05 09:56:05 -07:00
jsonb_plperl meson: Add windows resource files 2022-10-05 09:56:05 -07:00
jsonb_plpython meson: Add windows resource files 2022-10-05 09:56:05 -07:00
lo meson: Add windows resource files 2022-10-05 09:56:05 -07:00
ltree Remove unnecessary uses of Abs() 2022-10-07 13:29:33 +02:00
ltree_plpython meson: Add windows resource files 2022-10-05 09:56:05 -07:00
oid2name meson: Add windows resource files 2022-10-05 09:56:05 -07:00
old_snapshot meson: Add windows resource files 2022-10-05 09:56:05 -07:00
pageinspect meson: Add windows resource files 2022-10-05 09:56:05 -07:00
passwordcheck tests: Rename conflicting role names 2022-10-05 10:43:13 -07:00
pg_buffercache meson: Add windows resource files 2022-10-05 09:56:05 -07:00
pg_freespacemap meson: Add windows resource files 2022-10-05 09:56:05 -07:00
pg_prewarm meson: Add windows resource files 2022-10-05 09:56:05 -07:00
pg_stat_statements meson: Add windows resource files 2022-10-05 09:56:05 -07:00
pg_surgery meson: Add windows resource files 2022-10-05 09:56:05 -07:00
pg_trgm meson: Add support for building with precompiled headers 2022-10-06 17:19:30 -07:00
pg_visibility meson: Add windows resource files 2022-10-05 09:56:05 -07:00
pg_walinspect meson: Add windows resource files 2022-10-05 09:56:05 -07:00
pgcrypto meson: Add support for building with precompiled headers 2022-10-06 17:19:30 -07:00
pgrowlocks meson: Add windows resource files 2022-10-05 09:56:05 -07:00
pgstattuple meson: Add support for building with precompiled headers 2022-10-06 17:19:30 -07:00
postgres_fdw Allow batch insertion during COPY into a foreign table. 2022-10-13 18:45:00 +09:00
seg Use fabsf() instead of Abs() or fabs() where appropriate 2022-10-08 13:43:26 +02:00
sepgsql meson: Add support for building with precompiled headers 2022-10-06 17:19:30 -07:00
spi meson: Add windows resource files 2022-10-05 09:56:05 -07:00
sslinfo meson: Add windows resource files 2022-10-05 09:56:05 -07:00
start-scripts Remove contrib/start-scripts/osx/. 2017-11-17 12:53:20 -05:00
tablefunc meson: Add windows resource files 2022-10-05 09:56:05 -07:00
tcn meson: Add windows resource files 2022-10-05 09:56:05 -07:00
test_decoding Add missing isolation test for test_decoding in meson build 2022-10-13 16:03:01 +09:00
tsm_system_rows meson: Add windows resource files 2022-10-05 09:56:05 -07:00
tsm_system_time meson: Add windows resource files 2022-10-05 09:56:05 -07:00
unaccent meson: Add windows resource files 2022-10-05 09:56:05 -07:00
uuid-ossp meson: Add windows resource files 2022-10-05 09:56:05 -07:00
vacuumlo meson: Add windows resource files 2022-10-05 09:56:05 -07:00
xml2 meson: Add support for building with precompiled headers 2022-10-06 17:19:30 -07:00
contrib-global.mk Respect TEMP_CONFIG when pg_regress_check and friends are called 2016-02-27 12:28:21 -05:00
Makefile Add contrib/pg_walinspect. 2022-04-08 00:26:44 -07:00
meson.build meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
README Rename 'gmake' to 'make' in docs and recommended commands 2014-02-12 17:29:19 -05:00

The PostgreSQL contrib tree
---------------------------

This subtree contains porting tools, analysis utilities, and plug-in
features that are not part of the core PostgreSQL system, mainly
because they address a limited audience or are too experimental to be
part of the main source tree.  This does not preclude their
usefulness.

User documentation for each module appears in the main SGML
documentation.

When building from the source distribution, these modules are not
built automatically, unless you build the "world" target.  You can
also build and install them all by running "make all" and "make
install" in this directory; or to build and install just one selected
module, do the same in that module's subdirectory.

Some directories supply new user-defined functions, operators, or
types.  To make use of one of these modules, after you have installed
the code you need to register the new SQL objects in the database
system by executing a CREATE EXTENSION command.  In a fresh database,
you can simply do

    CREATE EXTENSION module_name;

See the PostgreSQL documentation for more information about this
procedure.