git.postgresql.org Git - postgresql.git/commit

git projects / postgresql.git / commit
? search:
summary | shortlog | log | commit | commitdiff | tree
(parent: 50e17ad) | patch
Allow TRUNCATE command to truncate foreign tables.
Thu, 8 Apr 2021 11:56:08 +0000 (20:56 +0900)
Thu, 8 Apr 2021 11:56:08 +0000 (20:56 +0900)
commit 8ff1c94649f5c9184ac5f07981d8aea9dfd7ac19
Allow TRUNCATE command to truncate foreign tables.

This commit introduces new foreign data wrapper API for TRUNCATE.
It extends TRUNCATE command so that it accepts foreign tables as
the targets to truncate and invokes that API. Also it extends postgres_fdw
so that it can issue TRUNCATE command to foreign servers, by adding
new routine for that TRUNCATE API.

The information about options specified in TRUNCATE command, e.g.,
ONLY, CACADE, etc is passed to FDW via API. The list of foreign tables to
truncate is also passed to FDW. FDW truncates the foreign data sources
that the passed foreign tables specify, based on those information.
For example, postgres_fdw constructs TRUNCATE command using them
and issues it to the foreign server.

For performance, TRUNCATE command invokes the FDW routine for
TRUNCATE once per foreign server that foreign tables to truncate belong to.

Author: Kazutaka Onishi, Kohei KaiGai, slightly modified by Fujii Masao
Reviewed-by: Bharath Rupireddy, Michael Paquier, Zhihong Yu, Alvaro Herrera, Stephen Frost, Ashutosh Bapat, Amit Langote, Daniel Gustafsson, Ibrar Ahmed, Fujii Masao
Discussion: https://postgr.es/m/CAOP8fzb_gkReLput7OvOK+8NHgw-RKqNv59vem7=524krQTcWA@mail.gmail.com
Discussion: https://postgr.es/m/CAJuF6cMWDDqU-vn_knZgma+2GMaout68YUgn1uyDnexRhqqM5Q@mail.gmail.com
17 files changed:
contrib/postgres_fdw/connection.c diff | blob | blame | history
contrib/postgres_fdw/deparse.c diff | blob | blame | history
contrib/postgres_fdw/expected/postgres_fdw.out diff | blob | blame | history
contrib/postgres_fdw/option.c diff | blob | blame | history
contrib/postgres_fdw/postgres_fdw.c diff | blob | blame | history
contrib/postgres_fdw/postgres_fdw.h diff | blob | blame | history
contrib/postgres_fdw/sql/postgres_fdw.sql diff | blob | blame | history
doc/src/sgml/fdwhandler.sgml diff | blob | blame | history
doc/src/sgml/postgres-fdw.sgml diff | blob | blame | history
doc/src/sgml/ref/truncate.sgml diff | blob | blame | history
src/backend/commands/tablecmds.c diff | blob | blame | history
src/backend/replication/logical/worker.c diff | blob | blame | history
src/include/commands/tablecmds.h diff | blob | blame | history
src/include/foreign/fdwapi.h diff | blob | blame | history
src/include/utils/rel.h diff | blob | blame | history
src/test/regress/expected/foreign_data.out diff | blob | blame | history
src/tools/pgindent/typedefs.list diff | blob | blame | history
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /