forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit3f7836f
committed
Fix calculation of which GENERATED columns need to be updated.
We were identifying the updatable generated columns of inheritancechildren by transposing the calculation made for their parent.However, there's nothing that says a traditional-inheritance childcan't have generated columns that aren't there in its parent, or thathave different dependencies than are in the parent's expression.(At present it seems that we don't enforce that for partitioningeither, which is likely wrong to some degree or other; but the caseclearly needs to be handled with traditional inheritance.)Hence, drop the very-klugy-anyway "extraUpdatedCols" RTE fieldin favor of identifying which generated columns depend on updatedcolumns during executor startup. In HEAD we can removeextraUpdatedCols altogether; in back branches, it's still there butalways empty. Another difference between the HEAD and back-branchversions of this patch is that in HEAD we can add the new bitmap fieldto ResultRelInfo, but that would cause an ABI break in back branches.Like4b3e379, add a List field at the end of struct EState instead.Back-patch to v13. The bogus calculation is also being made in v12,but it doesn't have the same visible effect because we don't use itto decide which generated columns to recalculate; as a consequence ofwhich the patch doesn't apply easily. I think that there might stillbe a demonstrable bug associated with trigger firing conditions, butthat's such a weird corner-case usage that I'm content to leave itunfixed in v12.Amit Langote and Tom LaneDiscussion:https://postgr.es/m/CA+HiwqFshLKNvQUd1DgwJ-7tsTp=dwv7KZqXC4j2wYBV1aCDUA@mail.gmail.comDiscussion:https://postgr.es/m/2793383.1672944799@sss.pgh.pa.us1 parent529da08 commit3f7836f
File tree
15 files changed
+257
-186
lines changed- src
- backend
- executor
- nodes
- optimizer/util
- replication/logical
- rewrite
- include
- nodes
- optimizer
- rewrite
- test/regress
- expected
- sql
15 files changed
+257
-186
lines changedLines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1225 | 1225 |
| |
1226 | 1226 |
| |
1227 | 1227 |
| |
| 1228 | + | |
1228 | 1229 |
| |
1229 | 1230 |
| |
1230 | 1231 |
| |
|
Lines changed: 8 additions & 17 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1342 | 1342 |
| |
1343 | 1343 |
| |
1344 | 1344 |
| |
1345 |
| - | |
1346 |
| - | |
1347 |
| - | |
| 1345 | + | |
| 1346 | + | |
| 1347 | + | |
| 1348 | + | |
1348 | 1349 |
| |
1349 |
| - | |
1350 |
| - | |
1351 |
| - | |
1352 |
| - | |
1353 |
| - | |
1354 |
| - | |
1355 |
| - | |
| 1350 | + | |
| 1351 | + | |
| 1352 | + | |
1356 | 1353 |
| |
1357 |
| - | |
1358 |
| - | |
1359 |
| - | |
1360 |
| - | |
1361 |
| - | |
1362 |
| - | |
1363 |
| - | |
| 1354 | + | |
1364 | 1355 |
| |
1365 | 1356 |
| |
1366 | 1357 |
| |
|
Lines changed: 107 additions & 47 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
54 | 54 |
| |
55 | 55 |
| |
56 | 56 |
| |
| 57 | + | |
57 | 58 |
| |
58 | 59 |
| |
59 | 60 |
| |
| |||
353 | 354 |
| |
354 | 355 |
| |
355 | 356 |
| |
356 |
| - | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
357 | 362 |
| |
358 |
| - | |
359 |
| - | |
360 |
| - | |
361 |
| - | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
362 | 367 |
| |
363 | 368 |
| |
364 | 369 |
| |
365 | 370 |
| |
| 371 | + | |
366 | 372 |
| |
367 |
| - | |
368 |
| - | |
369 | 373 |
| |
370 |
| - | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
371 | 380 |
| |
372 | 381 |
| |
373 |
| - | |
374 |
| - | |
375 |
| - | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
376 | 386 |
| |
377 |
| - | |
378 |
| - | |
379 |
| - | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
380 | 392 |
| |
381 |
| - | |
382 |
| - | |
383 |
| - | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
384 | 398 |
| |
385 |
| - | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
386 | 406 |
| |
387 |
| - | |
388 |
| - | |
389 |
| - | |
| 407 | + | |
390 | 408 |
| |
391 |
| - | |
392 |
| - | |
393 |
| - | |
394 |
| - | |
395 |
| - | |
396 |
| - | |
397 |
| - | |
398 |
| - | |
399 |
| - | |
400 |
| - | |
401 |
| - | |
402 |
| - | |
403 |
| - | |
404 |
| - | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
405 | 414 |
| |
406 |
| - | |
407 |
| - | |
408 |
| - | |
409 |
| - | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
410 | 424 |
| |
411 |
| - | |
412 |
| - | |
| 425 | + | |
| 426 | + | |
413 | 427 |
| |
414 |
| - | |
415 | 428 |
| |
416 |
| - | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
417 | 438 |
| |
418 | 439 |
| |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
419 | 471 |
| |
420 | 472 |
| |
421 | 473 |
| |
| |||
435 | 487 |
| |
436 | 488 |
| |
437 | 489 |
| |
438 |
| - | |
439 |
| - | |
| 490 | + | |
440 | 491 |
| |
441 |
| - | |
442 | 492 |
| |
443 | 493 |
| |
444 | 494 |
| |
445 |
| - | |
| 495 | + | |
| 496 | + | |
446 | 497 |
| |
447 | 498 |
| |
448 | 499 |
| |
| |||
4088 | 4139 |
| |
4089 | 4140 |
| |
4090 | 4141 |
| |
| 4142 | + | |
| 4143 | + | |
| 4144 | + | |
| 4145 | + | |
| 4146 | + | |
| 4147 | + | |
| 4148 | + | |
| 4149 | + | |
| 4150 | + | |
4091 | 4151 |
| |
4092 | 4152 |
| |
4093 | 4153 |
| |
|
Lines changed: 0 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
561 | 561 |
| |
562 | 562 |
| |
563 | 563 |
| |
564 |
| - | |
565 | 564 |
| |
566 | 565 |
| |
567 | 566 |
| |
|
Lines changed: 0 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
537 | 537 |
| |
538 | 538 |
| |
539 | 539 |
| |
540 |
| - | |
541 | 540 |
| |
542 | 541 |
| |
543 | 542 |
| |
|
0 commit comments
Comments
(0)