pgsql: Disable WAL-skipping optimization for COPY on views andforeign

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема pgsql: Disable WAL-skipping optimization for COPY on views andforeign
Дата
Msg-id E1gayVV-0000Sj-Pv@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Disable WAL-skipping optimization for COPY on views and foreign tables

COPY can skip writing WAL when loading data on a table which has been
created in the same transaction as the one loading the data, however
this cannot work on views or foreign table as this would result in
trying to flush relation files which do not exist.  So disable the
optimization so as commands are able to work the same way with any
configuration of wal_level.

Tests are added to cover the different cases, which need to have
wal_level set to minimal to allow the problem to show up, and that is
not the default configuration.

Reported-by: Luis M. Carril, Etsuro Fujita
Author: Amit Langote, Michael Paquier
Reviewed-by: Etsuro Fujita
Discussion: https://postgr.es/m/15552-c64aa14c5c22f63c@postgresql.org
Backpatch-through: 10, where support for COPY on views has been added,
while v11 has added support for COPY on foreign tables.

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/bf491a9073e12ce1fc3e6facd0ae1308534df570

Modified Files
--------------
contrib/postgres_fdw/expected/postgres_fdw.out | 16 ++++++++++++++++
contrib/postgres_fdw/sql/postgres_fdw.sql      | 14 ++++++++++++++
src/backend/commands/copy.c                    |  7 ++++++-
src/test/regress/expected/copy2.out            | 18 ++++++++++++++++++
src/test/regress/sql/copy2.sql                 | 16 ++++++++++++++++
5 files changed, 70 insertions(+), 1 deletion(-)


В списке pgsql-committers по дате отправления:

Предыдущее
От: Michael Paquier
Дата:
Сообщение: pgsql: Add completion for storage parameters after CREATE TABLE WITHin
Следующее
От: Michael Paquier
Дата:
Сообщение: pgsql: Prioritize history files when archiving