pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Disable WAL-skipping optimization for COPY on views and foreign
3+ messages / 1 participants
[nested] [flat]

* pgsql: Disable WAL-skipping optimization for COPY on views and foreign
@ 2018-12-23 07:49  Michael Paquier <michael@paquier.xyz>
  0 siblings, 0 replies; 3+ messages in thread

From: Michael Paquier @ 2018-12-23 07:49 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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(-)



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* pgsql: Disable WAL-skipping optimization for COPY on views and foreign
@ 2018-12-23 07:49  Michael Paquier <michael@paquier.xyz>
  0 siblings, 0 replies; 3+ messages in thread

From: Michael Paquier @ 2018-12-23 07:49 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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
------
REL_11_STABLE

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

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



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* pgsql: Disable WAL-skipping optimization for COPY on views
@ 2018-12-23 07:49  Michael Paquier <michael@paquier.xyz>
  0 siblings, 0 replies; 3+ messages in thread

From: Michael Paquier @ 2018-12-23 07:49 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Disable WAL-skipping optimization for COPY on views

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 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.

A test is added to cover this case, which needs to have wal_level set to
minimal to allow the problem to show up, and that is not the default
configuration.

Reported-by: Etsuro Fujita
Author: 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
------
REL_10_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/15f69279e0e85bc4b3cf9593ad090515e500613c

Modified Files
--------------
src/backend/commands/copy.c         |  5 +++++
src/test/regress/expected/copy2.out | 18 ++++++++++++++++++
src/test/regress/sql/copy2.sql      | 16 ++++++++++++++++
3 files changed, 39 insertions(+)



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2018-12-23 07:49 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-12-23 07:49 pgsql: Disable WAL-skipping optimization for COPY on views and foreign Michael Paquier <michael@paquier.xyz>
2018-12-23 07:49 pgsql: Disable WAL-skipping optimization for COPY on views and foreign Michael Paquier <michael@paquier.xyz>
2018-12-23 07:49 pgsql: Disable WAL-skipping optimization for COPY on views Michael Paquier <michael@paquier.xyz>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox