postgresql/src/backend
Michael Paquier bf491a9073 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.
2018-12-23 16:42:22 +09:00
..
access Check for conflicting queries during replay of gistvacuumpage() 2018-12-21 02:37:37 +03:00
bootstrap Make type "name" collation-aware. 2018-12-19 17:46:25 -05:00
catalog Base information_schema.sql_identifier domain on name, not varchar. 2018-12-20 16:21:59 -05:00
commands Disable WAL-skipping optimization for COPY on views and foreign tables 2018-12-23 16:42:22 +09:00
executor Add some const decorations 2018-12-22 07:45:09 +01:00
foreign Introduce new extended routines for FDW and foreign server lookups 2018-12-14 08:59:35 +09:00
jit Fix jit compilation bug on wide tables. 2018-11-27 10:07:03 -08:00
lib Rename rbtree.c functions to use "rbt" prefix not "rb" prefix. 2018-11-06 13:25:24 -05:00
libpq Fix typo 2018-12-04 11:04:54 -05:00
main Update copyright for 2018 2018-01-02 23:30:12 -05:00
nodes Add WRITE_*_ARRAY macros 2018-12-22 07:45:13 +01:00
optimizer Add text-vs-name cross-type operators, and unify name_ops with text_ops. 2018-12-19 17:46:25 -05:00
parser Make type "name" collation-aware. 2018-12-19 17:46:25 -05:00
partitioning Reduce unnecessary list construction in RelationBuildPartitionDesc. 2018-11-19 12:10:41 -05:00
po Translation updates 2018-06-25 12:37:18 +02:00
port Fix spelling errors and typos in comments 2018-11-02 13:56:52 +01:00
postmaster Modernize our code for looking up descriptive strings for Unix signals. 2018-12-16 19:38:57 -05:00
regex Clean up warnings from -Wimplicit-fallthrough. 2018-05-01 19:35:08 -04:00
replication Add timestamp of last received message from standby to pg_stat_replication 2018-12-09 16:35:06 +09:00
rewrite Remove WITH OIDS support, change oid catalog column visibility. 2018-11-20 16:00:17 -08:00
snowball Sync our Snowball stemmer dictionaries with current upstream. 2018-09-24 17:29:38 -04:00
statistics Make pg_statistic and related code account more honestly for collations. 2018-12-14 12:52:49 -05:00
storage Have BufFileSize() ereport() on FileSize() failure. 2018-11-28 14:42:54 -08:00
tcop Silence compiler warning 2018-11-30 10:20:49 -03:00
tsearch Make pg_statistic and related code account more honestly for collations. 2018-12-14 12:52:49 -05:00
utils Avoid producing over-length specific_name outputs in information_schema. 2018-12-20 16:21:59 -05:00
.gitignore Add .gitignore entries for AIX-specific intermediate build artifacts. 2015-07-08 20:44:22 -04:00
common.mk Remove PARTIAL_LINKING build mode. 2018-03-30 17:33:04 -07:00
Makefile Integrate recovery.conf into postgresql.conf 2018-11-25 16:33:40 +01:00
nls.mk Translation updates 2018-06-25 12:37:18 +02:00