- Notifications
You must be signed in to change notification settings - Fork28
Commit086ffdd
committed
Fix several DDL issues of generated columns versus inheritance
Several combinations of generated columns and inheritance in CREATETABLE were not handled correctly. Specifically:- Disallow a child column specifying a generation expression if the parent column is a generated column. The child column definition must be unadorned and the parent column's generation expression will be copied.- Prohibit a child column of a generated parent column specifying default values or identity.- Allow a child column of a not-generated parent column specifying itself as a generated column. This previously did not work, but it was possible to arrive at the state via other means (involving ALTER TABLE), so it seems sensible to support it.Add tests for each case. Also add documentation about the rulesinvolving generated columns and inheritance.Discussion:https://www.postgresql.org/message-id/flat/15830.1575468847%40sss.pgh.pa.ushttps://www.postgresql.org/message-id/flat/2678bad1-048f-519a-ef24-b12962f41807%40enterprisedb.comhttps://www.postgresql.org/message-id/flat/CAJvUf_u4h0DxkCMCeEKAWCuzGUTnDP-G5iVmSwxLQSXn0_FWNQ%40mail.gmail.com1 parent501e41d commit086ffdd
File tree
4 files changed
+146
-7
lines changed- doc/src/sgml
- src
- backend/commands
- test/regress
- expected
- sql
4 files changed
+146
-7
lines changedLines changed: 26 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
324 | 324 |
| |
325 | 325 |
| |
326 | 326 |
| |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
327 | 353 |
| |
328 | 354 |
| |
329 | 355 |
| |
|
Lines changed: 56 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2618 | 2618 |
| |
2619 | 2619 |
| |
2620 | 2620 |
| |
| 2621 | + | |
| 2622 | + | |
| 2623 | + | |
| 2624 | + | |
| 2625 | + | |
| 2626 | + | |
| 2627 | + | |
| 2628 | + | |
| 2629 | + | |
| 2630 | + | |
| 2631 | + | |
| 2632 | + | |
| 2633 | + | |
| 2634 | + | |
| 2635 | + | |
| 2636 | + | |
| 2637 | + | |
| 2638 | + | |
| 2639 | + | |
| 2640 | + | |
| 2641 | + | |
| 2642 | + | |
| 2643 | + | |
| 2644 | + | |
| 2645 | + | |
| 2646 | + | |
| 2647 | + | |
| 2648 | + | |
| 2649 | + | |
| 2650 | + | |
| 2651 | + | |
| 2652 | + | |
| 2653 | + | |
| 2654 | + | |
| 2655 | + | |
| 2656 | + | |
| 2657 | + | |
| 2658 | + | |
| 2659 | + | |
| 2660 | + | |
| 2661 | + | |
| 2662 | + | |
2621 | 2663 |
| |
2622 | 2664 |
| |
2623 | 2665 |
| |
2624 | 2666 |
| |
2625 | 2667 |
| |
2626 | 2668 |
| |
| 2669 | + | |
2627 | 2670 |
| |
2628 | 2671 |
| |
2629 | 2672 |
| |
| |||
2709 | 2752 |
| |
2710 | 2753 |
| |
2711 | 2754 |
| |
2712 |
| - | |
2713 |
| - | |
2714 |
| - | |
2715 |
| - | |
2716 |
| - | |
| 2755 | + | |
| 2756 | + | |
| 2757 | + | |
| 2758 | + | |
| 2759 | + | |
| 2760 | + | |
| 2761 | + | |
| 2762 | + | |
| 2763 | + | |
| 2764 | + | |
| 2765 | + | |
| 2766 | + | |
| 2767 | + | |
2717 | 2768 |
| |
2718 | 2769 |
| |
2719 | 2770 |
| |
|
Lines changed: 43 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
219 | 219 |
| |
220 | 220 |
| |
221 | 221 |
| |
222 |
| - | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
223 | 255 |
| |
224 | 256 |
| |
225 | 257 |
| |
226 | 258 |
| |
227 | 259 |
| |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
228 | 270 |
| |
229 | 271 |
| |
230 | 272 |
| |
|
Lines changed: 21 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
89 | 89 |
| |
90 | 90 |
| |
91 | 91 |
| |
92 |
| - | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
93 | 105 |
| |
94 | 106 |
| |
95 | 107 |
| |
96 | 108 |
| |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
97 | 117 |
| |
98 | 118 |
| |
99 | 119 |
| |
|
0 commit comments
Comments
(0)