forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitf7c830f
committed
Fix missing calls to table_finish_bulk_insert during COPY, take 2
86b8504 abstracted calls to heap functions in COPY FROM to support ageneric table AM. However, when performing a copy into a partitionedtable, this commit neglected to call table_finish_bulk_insert for eachpartition. Before86b8504, when we always called the heap functions,there was no need to call heapam_finish_bulk_insert for partitions sinceit only did any work when performing a copy without WAL. For partitionedtables, this was unsupported anyway, so there was no issue. Withpluggable storage, we can't make any assumptions about what the table AMmight want to do in its equivalent function, so we'd better ensure wealways call table_finish_bulk_insert each partition that's received a row.For now, we make the table_finish_bulk_insert call whenever we evict aCopyMultiInsertBuffer out of the CopyMultiInsertInfo. This does meanthat it's possible that we call table_finish_bulk_insert multiple timesper partition, which is not a problem other than being an inefficiency.Improving this requires a more invasive patch, so let's leave that foranother day.This also changes things so that we no longer needlessly calltable_finish_bulk_insert when performing a COPY FROM for a non-partitionedtable when not using multi-inserts.Reported-by: Robert HaasBackpatch-through: 12Discussion:https://postgr.es/m/CA+TgmoYK=6BpxiJ0tN-p9wtH0BTAfbdxzHhwou0mdud4+BkYuQ@mail.gmail.com1 parentbd56cd7 commitf7c830f
1 file changed
+11
-8
lines changedLines changed: 11 additions & 8 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2518 | 2518 |
| |
2519 | 2519 |
| |
2520 | 2520 |
| |
2521 |
| - | |
| 2521 | + | |
| 2522 | + | |
2522 | 2523 |
| |
2523 | 2524 |
| |
2524 | 2525 |
| |
| |||
2534 | 2535 |
| |
2535 | 2536 |
| |
2536 | 2537 |
| |
| 2538 | + | |
| 2539 | + | |
| 2540 | + | |
2537 | 2541 |
| |
2538 | 2542 |
| |
2539 | 2543 |
| |
| |||
2585 | 2589 |
| |
2586 | 2590 |
| |
2587 | 2591 |
| |
2588 |
| - | |
| 2592 | + | |
2589 | 2593 |
| |
2590 | 2594 |
| |
2591 | 2595 |
| |
| |||
2599 | 2603 |
| |
2600 | 2604 |
| |
2601 | 2605 |
| |
2602 |
| - | |
| 2606 | + | |
2603 | 2607 |
| |
2604 | 2608 |
| |
2605 | 2609 |
| |
| |||
3321 | 3325 |
| |
3322 | 3326 |
| |
3323 | 3327 |
| |
3324 |
| - | |
3325 |
| - | |
3326 |
| - | |
3327 | 3328 |
| |
3328 | 3329 |
| |
3329 | 3330 |
| |
| |||
3355 | 3356 |
| |
3356 | 3357 |
| |
3357 | 3358 |
| |
| 3359 | + | |
| 3360 | + | |
| 3361 | + | |
| 3362 | + | |
3358 | 3363 |
| |
3359 | 3364 |
| |
3360 | 3365 |
| |
| |||
3366 | 3371 |
| |
3367 | 3372 |
| |
3368 | 3373 |
| |
3369 |
| - | |
3370 |
| - | |
3371 | 3374 |
| |
3372 | 3375 |
| |
3373 | 3376 |
| |
|
0 commit comments
Comments
(0)