pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Disable WAL-skipping optimization for COPY on views
Date: Sun, 23 Dec 2018 07:49:05 +0000
Message-ID: <E1gayVV-0000Sm-Q7@gemulon.postgresql.org> (raw)

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



view thread (3+ messages)

Message-ID: <E1gayVV-0000Sm-Q7@gemulon.postgresql.org>
Permalink:  ../E1gayVV-0000Sm-Q7@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1gayVV-0000Sm-Q7@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: michael@paquier.xyz
  Subject: Re: pgsql: Disable WAL-skipping optimization for COPY on views
  In-Reply-To: <E1gayVV-0000Sm-Q7@gemulon.postgresql.org>
  References: <E1gayVV-0000Sm-Q7@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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