- Notifications
You must be signed in to change notification settings - Fork28
Commit533c5d8
committed
Fix application of identity values in some cases
Investigation of2d2d06b revealed thatidentity values were not applied in some further cases, includinglogical replication subscribers, VALUES RTEs, and ALTER TABLE ... ADDCOLUMN. To fix all that, apply the identity column expression inbuild_column_default() instead of repeating the same logic at each callsite.For ALTER TABLE ... ADD COLUMN ... IDENTITY, the previous codingcompletely ignored that existing rows for the new column should havevalues filled in from the identity sequence. The coding usingbuild_column_default() fails for this because the sequence ownershipisn't registered until after ALTER TABLE, and we can't do it beforebecause we don't have the column in the catalog yet. So we speciallyremember in ColumnDef the sequence name that we decided on and build acustom NextValueExpr using that.Reviewed-by: Michael Paquier <michael.paquier@gmail.com>1 parent9da0cc3 commit533c5d8
File tree
11 files changed
+102
-30
lines changed- src
- backend
- commands
- nodes
- parser
- rewrite
- include/nodes
- test
- regress
- expected
- sql
- subscription/t
11 files changed
+102
-30
lines changedLines changed: 2 additions & 14 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
23 | 23 |
| |
24 | 24 |
| |
25 | 25 |
| |
26 |
| - | |
27 | 26 |
| |
28 | 27 |
| |
29 | 28 |
| |
| |||
2996 | 2995 |
| |
2997 | 2996 |
| |
2998 | 2997 |
| |
2999 |
| - | |
3000 |
| - | |
3001 |
| - | |
3002 |
| - | |
3003 |
| - | |
3004 |
| - | |
3005 |
| - | |
3006 |
| - | |
3007 |
| - | |
3008 |
| - | |
3009 |
| - | |
3010 |
| - | |
3011 |
| - | |
| 2998 | + | |
| 2999 | + | |
3012 | 3000 |
| |
3013 | 3001 |
| |
3014 | 3002 |
| |
|
Lines changed: 15 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
5486 | 5486 |
| |
5487 | 5487 |
| |
5488 | 5488 |
| |
5489 |
| - | |
| 5489 | + | |
| 5490 | + | |
| 5491 | + | |
| 5492 | + | |
| 5493 | + | |
| 5494 | + | |
| 5495 | + | |
| 5496 | + | |
| 5497 | + | |
| 5498 | + | |
| 5499 | + | |
| 5500 | + | |
| 5501 | + | |
| 5502 | + | |
| 5503 | + | |
5490 | 5504 |
| |
5491 | 5505 |
| |
5492 | 5506 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2819 | 2819 |
| |
2820 | 2820 |
| |
2821 | 2821 |
| |
| 2822 | + | |
2822 | 2823 |
| |
2823 | 2824 |
| |
2824 | 2825 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2564 | 2564 |
| |
2565 | 2565 |
| |
2566 | 2566 |
| |
| 2567 | + | |
2567 | 2568 |
| |
2568 | 2569 |
| |
2569 | 2570 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2814 | 2814 |
| |
2815 | 2815 |
| |
2816 | 2816 |
| |
| 2817 | + | |
2817 | 2818 |
| |
2818 | 2819 |
| |
2819 | 2820 |
| |
|
Lines changed: 8 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
472 | 472 |
| |
473 | 473 |
| |
474 | 474 |
| |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
475 | 483 |
| |
476 | 484 |
| |
477 | 485 |
| |
|
Lines changed: 11 additions & 11 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
844 | 844 |
| |
845 | 845 |
| |
846 | 846 |
| |
847 |
| - | |
848 |
| - | |
849 |
| - | |
850 |
| - | |
851 |
| - | |
852 |
| - | |
853 |
| - | |
854 |
| - | |
855 |
| - | |
856 |
| - | |
857 |
| - | |
| 847 | + | |
858 | 848 |
| |
859 | 849 |
| |
860 | 850 |
| |
| |||
1123 | 1113 |
| |
1124 | 1114 |
| |
1125 | 1115 |
| |
| 1116 | + | |
| 1117 | + | |
| 1118 | + | |
| 1119 | + | |
| 1120 | + | |
| 1121 | + | |
| 1122 | + | |
| 1123 | + | |
| 1124 | + | |
| 1125 | + | |
1126 | 1126 |
| |
1127 | 1127 |
| |
1128 | 1128 |
| |
|
Lines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
647 | 647 |
| |
648 | 648 |
| |
649 | 649 |
| |
| 650 | + | |
| 651 | + | |
650 | 652 |
| |
651 | 653 |
| |
652 | 654 |
| |
|
Lines changed: 28 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
104 | 104 |
| |
105 | 105 |
| |
106 | 106 |
| |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
107 | 120 |
| |
108 | 121 |
| |
109 | 122 |
| |
| |||
237 | 250 |
| |
238 | 251 |
| |
239 | 252 |
| |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
240 | 268 |
| |
241 | 269 |
| |
242 | 270 |
| |
|
Lines changed: 19 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
54 | 54 |
| |
55 | 55 |
| |
56 | 56 |
| |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
57 | 65 |
| |
58 | 66 |
| |
59 | 67 |
| |
| |||
138 | 146 |
| |
139 | 147 |
| |
140 | 148 |
| |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
141 | 160 |
| |
142 | 161 |
| |
143 | 162 |
| |
|
Lines changed: 14 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3 | 3 |
| |
4 | 4 |
| |
5 | 5 |
| |
6 |
| - | |
| 6 | + | |
7 | 7 |
| |
8 | 8 |
| |
9 | 9 |
| |
| |||
22 | 22 |
| |
23 | 23 |
| |
24 | 24 |
| |
25 |
| - | |
| 25 | + | |
26 | 26 |
| |
27 | 27 |
| |
28 | 28 |
| |
| |||
52 | 52 |
| |
53 | 53 |
| |
54 | 54 |
| |
55 |
| - | |
56 |
| - | |
| 55 | + | |
| 56 | + | |
57 | 57 |
| |
58 | 58 |
| |
59 | 59 |
| |
| |||
67 | 67 |
| |
68 | 68 |
| |
69 | 69 |
| |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
70 | 80 |
| |
71 | 81 |
|
0 commit comments
Comments
(0)