forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitbf491a9
committed
Disable WAL-skipping optimization for COPY on views and foreign tables
COPY can skip writing WAL when loading data on a table which has beencreated in the same transaction as the one loading the data, howeverthis cannot work on views or foreign table as this would result intrying to flush relation files which do not exist. So disable theoptimization so as commands are able to work the same way with anyconfiguration of wal_level.Tests are added to cover the different cases, which need to havewal_level set to minimal to allow the problem to show up, and that isnot the default configuration.Reported-by: Luis M. Carril, Etsuro FujitaAuthor: Amit Langote, Michael PaquierReviewed-by: Etsuro FujitaDiscussion:https://postgr.es/m/15552-c64aa14c5c22f63c@postgresql.orgBackpatch-through: 10, where support for COPY on views has been added,while v11 has added support for COPY on foreign tables.1 parent11a60d4 commitbf491a9
File tree
5 files changed
+70
-1
lines changed- contrib/postgres_fdw
- expected
- sql
- src
- backend/commands
- test/regress
- expected
- sql
5 files changed
+70
-1
lines changedLines changed: 16 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
7981 | 7981 |
| |
7982 | 7982 |
| |
7983 | 7983 |
| |
| 7984 | + | |
| 7985 | + | |
| 7986 | + | |
| 7987 | + | |
| 7988 | + | |
| 7989 | + | |
| 7990 | + | |
| 7991 | + | |
| 7992 | + | |
| 7993 | + | |
| 7994 | + | |
| 7995 | + | |
| 7996 | + | |
| 7997 | + | |
| 7998 | + | |
| 7999 | + | |
7984 | 8000 |
| |
7985 | 8001 |
| |
7986 | 8002 |
| |
|
Lines changed: 14 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2124 | 2124 |
| |
2125 | 2125 |
| |
2126 | 2126 |
| |
| 2127 | + | |
| 2128 | + | |
| 2129 | + | |
| 2130 | + | |
| 2131 | + | |
| 2132 | + | |
| 2133 | + | |
| 2134 | + | |
| 2135 | + | |
| 2136 | + | |
| 2137 | + | |
| 2138 | + | |
| 2139 | + | |
| 2140 | + | |
2127 | 2141 |
| |
2128 | 2142 |
| |
2129 | 2143 |
| |
|
Lines changed: 6 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2397 | 2397 |
| |
2398 | 2398 |
| |
2399 | 2399 |
| |
| 2400 | + | |
| 2401 | + | |
| 2402 | + | |
| 2403 | + | |
| 2404 | + | |
2400 | 2405 |
| |
2401 | 2406 |
| |
2402 | 2407 |
| |
2403 |
| - | |
| 2408 | + | |
2404 | 2409 |
| |
2405 | 2410 |
| |
2406 | 2411 |
| |
|
Lines changed: 18 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
545 | 545 |
| |
546 | 546 |
| |
547 | 547 |
| |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
548 | 565 |
| |
549 | 566 |
| |
550 | 567 |
| |
| |||
557 | 574 |
| |
558 | 575 |
| |
559 | 576 |
| |
| 577 | + | |
560 | 578 |
|
Lines changed: 16 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
398 | 398 |
| |
399 | 399 |
| |
400 | 400 |
| |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
401 | 416 |
| |
402 | 417 |
| |
403 | 418 |
| |
| |||
411 | 426 |
| |
412 | 427 |
| |
413 | 428 |
| |
| 429 | + | |
414 | 430 |
|
0 commit comments
Comments
(0)