forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit8bf6ec3
committed
Improve handling of inherited GENERATED expressions.
In both partitioning and traditional inheritance, require childcolumns to be GENERATED if and only if their parent(s) are.Formerly we allowed the case of an inherited column beingGENERATED when its parent isn't, but that results in inconsistentbehavior: the column can be directly updated through an UPDATEon the parent table, leading to it containing a user-suppliedvalue that might not match the generation expression. This alsofixes an oversight that we enforced partition-key-columns-can't-be-GENERATED against parent tables, but not against child tablesthat were dynamically attached to them.Also, remove the restriction that the child's generation expressionbe equivalent to the parent's. In the wake of commit3f7836f,there doesn't seem to be any reason that we need that restriction,since generation expressions are always computed per-table anyway.By removing this, we can also allow a child to merge multipleinheritance parents with inconsistent generation expressions, byoverriding them with its own expression, much as we've long allowedfor DEFAULT expressions.Since we're rejecting a case that we used to accept, this doesn'tseem like a back-patchable change. Given the lack of fieldcomplaints about the inconsistent behavior, it's likely that noone is doing this anyway, but we won't change it in minor releases.Amit Langote and Tom LaneDiscussion:https://postgr.es/m/2793383.1672944799@sss.pgh.pa.us1 parentd0d9683 commit8bf6ec3
File tree
7 files changed
+240
-196
lines changed- doc/src/sgml
- src
- backend
- commands
- parser
- bin/pg_dump
- test/regress
- expected
- sql
7 files changed
+240
-196
lines changedLines changed: 37 additions & 10 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
325 | 325 |
| |
326 | 326 |
| |
327 | 327 |
| |
328 |
| - | |
| 328 | + | |
329 | 329 |
| |
330 | 330 |
| |
331 | 331 |
| |
332 |
| - | |
333 |
| - | |
334 |
| - | |
335 |
| - | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
336 | 339 |
| |
337 | 340 |
| |
338 | 341 |
| |
339 | 342 |
| |
340 |
| - | |
341 |
| - | |
342 |
| - | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
343 | 356 |
| |
344 | 357 |
| |
345 | 358 |
| |
346 | 359 |
| |
347 |
| - | |
348 |
| - | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
349 | 376 |
| |
350 | 377 |
| |
351 | 378 |
| |
|
Lines changed: 46 additions & 78 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2320 | 2320 |
| |
2321 | 2321 |
| |
2322 | 2322 |
| |
2323 |
| - | |
2324 |
| - | |
| 2323 | + | |
| 2324 | + | |
| 2325 | + | |
| 2326 | + | |
| 2327 | + | |
| 2328 | + | |
2325 | 2329 |
| |
2326 | 2330 |
| |
2327 | 2331 |
| |
| |||
2659 | 2663 |
| |
2660 | 2664 |
| |
2661 | 2665 |
| |
2662 |
| - | |
| 2666 | + | |
2663 | 2667 |
| |
2664 | 2668 |
| |
2665 | 2669 |
| |
| |||
2923 | 2927 |
| |
2924 | 2928 |
| |
2925 | 2929 |
| |
2926 |
| - | |
2927 |
| - | |
2928 |
| - | |
2929 |
| - | |
2930 |
| - | |
2931 |
| - | |
2932 |
| - | |
2933 |
| - | |
| 2930 | + | |
| 2931 | + | |
| 2932 | + | |
| 2933 | + | |
| 2934 | + | |
| 2935 | + | |
| 2936 | + | |
| 2937 | + | |
| 2938 | + | |
| 2939 | + | |
| 2940 | + | |
2934 | 2941 |
| |
2935 | 2942 |
| |
2936 | 2943 |
| |
2937 |
| - | |
2938 |
| - | |
2939 |
| - | |
2940 |
| - | |
2941 |
| - | |
2942 |
| - | |
2943 | 2944 |
| |
2944 | 2945 |
| |
2945 | 2946 |
| |
| |||
2951 | 2952 |
| |
2952 | 2953 |
| |
2953 | 2954 |
| |
2954 |
| - | |
2955 |
| - | |
2956 |
| - | |
2957 |
| - | |
2958 |
| - | |
2959 | 2955 |
| |
2960 | 2956 |
| |
2961 | 2957 |
| |
2962 |
| - | |
| 2958 | + | |
| 2959 | + | |
| 2960 | + | |
| 2961 | + | |
| 2962 | + | |
2963 | 2963 |
| |
2964 | 2964 |
| |
2965 | 2965 |
| |
| |||
2994 | 2994 |
| |
2995 | 2995 |
| |
2996 | 2996 |
| |
2997 |
| - | |
2998 |
| - | |
| 2997 | + | |
| 2998 | + | |
2999 | 2999 |
| |
3000 | 3000 |
| |
3001 | 3001 |
| |
| |||
3014 | 3014 |
| |
3015 | 3015 |
| |
3016 | 3016 |
| |
| 3017 | + | |
| 3018 | + | |
| 3019 | + | |
| 3020 | + | |
| 3021 | + | |
| 3022 | + | |
| 3023 | + | |
| 3024 | + | |
| 3025 | + | |
| 3026 | + | |
| 3027 | + | |
| 3028 | + | |
| 3029 | + | |
3017 | 3030 |
| |
3018 | 3031 |
| |
3019 | 3032 |
| |
| |||
3058 | 3071 |
| |
3059 | 3072 |
| |
3060 | 3073 |
| |
3061 |
| - | |
| 3074 | + | |
| 3075 | + | |
3062 | 3076 |
| |
3063 | 3077 |
| |
3064 | 3078 |
| |
| |||
15038 | 15052 |
| |
15039 | 15053 |
| |
15040 | 15054 |
| |
15041 |
| - | |
| 15055 | + | |
15042 | 15056 |
| |
15043 | 15057 |
| |
15044 | 15058 |
| |
15045 | 15059 |
| |
15046 | 15060 |
| |
15047 | 15061 |
| |
15048 |
| - | |
15049 |
| - | |
15050 |
| - | |
15051 |
| - | |
15052 |
| - | |
15053 |
| - | |
15054 |
| - | |
15055 |
| - | |
15056 |
| - | |
15057 |
| - | |
15058 |
| - | |
15059 |
| - | |
15060 |
| - | |
15061 |
| - | |
15062 |
| - | |
15063 |
| - | |
15064 |
| - | |
15065 |
| - | |
15066 |
| - | |
15067 |
| - | |
15068 |
| - | |
15069 |
| - | |
15070 |
| - | |
15071 |
| - | |
15072 |
| - | |
15073 |
| - | |
15074 |
| - | |
15075 |
| - | |
15076 |
| - | |
15077 |
| - | |
15078 |
| - | |
15079 |
| - | |
15080 |
| - | |
15081 |
| - | |
15082 |
| - | |
15083 |
| - | |
15084 |
| - | |
15085 |
| - | |
15086 |
| - | |
15087 |
| - | |
15088 |
| - | |
15089 |
| - | |
15090 |
| - | |
15091 |
| - | |
15092 |
| - | |
15093 |
| - | |
15094 |
| - | |
15095 |
| - | |
15096 |
| - | |
15097 |
| - | |
15098 |
| - | |
| 15062 | + | |
| 15063 | + | |
| 15064 | + | |
| 15065 | + | |
| 15066 | + | |
15099 | 15067 |
| |
15100 | 15068 |
| |
15101 | 15069 |
| |
|
Lines changed: 0 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
740 | 740 |
| |
741 | 741 |
| |
742 | 742 |
| |
743 |
| - | |
744 |
| - | |
745 |
| - | |
746 |
| - | |
747 |
| - | |
748 | 743 |
| |
749 | 744 |
| |
750 | 745 |
| |
|
Lines changed: 29 additions & 14 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
452 | 452 |
| |
453 | 453 |
| |
454 | 454 |
| |
455 |
| - | |
456 |
| - | |
457 |
| - | |
458 |
| - | |
459 |
| - | |
460 |
| - | |
461 |
| - | |
462 |
| - | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
463 | 464 |
| |
464 | 465 |
| |
465 | 466 |
| |
| |||
497 | 498 |
| |
498 | 499 |
| |
499 | 500 |
| |
500 |
| - | |
| 501 | + | |
| 502 | + | |
501 | 503 |
| |
502 | 504 |
| |
503 | 505 |
| |
504 | 506 |
| |
505 | 507 |
| |
506 | 508 |
| |
507 | 509 |
| |
508 |
| - | |
| 510 | + | |
| 511 | + | |
509 | 512 |
| |
510 | 513 |
| |
511 | 514 |
| |
| |||
517 | 520 |
| |
518 | 521 |
| |
519 | 522 |
| |
520 |
| - | |
521 |
| - | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
522 | 536 |
| |
523 | 537 |
| |
524 | 538 |
| |
| |||
561 | 575 |
| |
562 | 576 |
| |
563 | 577 |
| |
564 |
| - | |
565 |
| - | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
566 | 581 |
| |
567 | 582 |
| |
568 | 583 |
| |
|
Lines changed: 3 additions & 9 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
8529 | 8529 |
| |
8530 | 8530 |
| |
8531 | 8531 |
| |
8532 |
| - | |
8533 |
| - | |
8534 |
| - | |
8535 |
| - | |
8536 |
| - | |
8537 |
| - | |
8538 |
| - | |
| 8532 | + | |
8539 | 8533 |
| |
8540 | 8534 |
| |
8541 |
| - | |
8542 |
| - | |
| 8535 | + | |
| 8536 | + | |
8543 | 8537 |
| |
8544 | 8538 |
| |
8545 | 8539 |
| |
|
0 commit comments
Comments
(0)