forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit23b75dd
committed
Fix some more cases of missed GENERATED-column updates.
If UPDATE is forced to retry after an EvalPlanQual check, it neglectedto repeat GENERATED-column computations, even though those might wellhave changed since we're dealing with a different tuple than before.Fixing this is mostly a matter of looping back a bit further whenwe retry. In v15 and HEAD that's most easily done by altering the APIof ExecUpdateAct so that it includes computing GENERATED expressions.Also, if an UPDATE in a partitioned table turns into a cross-partitionINSERT operation, we failed to recompute GENERATED columns. That's abug since8bf6ec3 allowed partitions to have different generationexpressions; although it seems to have no ill effects before that.Fixing this is messier because we can now have situations where the samequery needs both the UPDATE-aligned set of GENERATED columns and theINSERT-aligned set, and it's unclear which set will be generated first(else we could hack things by forcing the INSERT-aligned set to begenerated, which is indeed howfe9e658 made it work for MERGE).The best fix seems to be to build and store separate sets of expressionsfor the INSERT and UPDATE cases. That would create ABI issues in theback branches, but so far it seems we can leave this alone in the backbranches.Per bug #17823 from Hisahiro Kauchi. The first part of this affects allbranches back to v12 where GENERATED columns were added.Discussion:https://postgr.es/m/17823-b64909cf7d63de84@postgresql.org1 parentafa122e commit23b75dd
File tree
5 files changed
+204
-160
lines changed- src
- backend/executor
- test
- isolation
- expected
- specs
- regress
- expected
- sql
5 files changed
+204
-160
lines changedLines changed: 10 additions & 11 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1193 | 1193 |
| |
1194 | 1194 |
| |
1195 | 1195 |
| |
| 1196 | + | |
| 1197 | + | |
| 1198 | + | |
| 1199 | + | |
| 1200 | + | |
| 1201 | + | |
| 1202 | + | |
| 1203 | + | |
| 1204 | + | |
1196 | 1205 |
| |
1197 | 1206 |
| |
1198 | 1207 |
| |
| |||
1206 | 1215 |
| |
1207 | 1216 |
| |
1208 | 1217 |
| |
1209 |
| - | |
1210 |
| - | |
1211 |
| - | |
1212 |
| - | |
1213 |
| - | |
1214 |
| - | |
1215 |
| - | |
1216 |
| - | |
1217 |
| - | |
1218 |
| - | |
1219 |
| - | |
1220 | 1218 |
| |
1221 | 1219 |
| |
1222 | 1220 |
| |
| |||
1231 | 1229 |
| |
1232 | 1230 |
| |
1233 | 1231 |
| |
| 1232 | + | |
1234 | 1233 |
| |
1235 | 1234 |
| |
1236 | 1235 |
| |
|
0 commit comments
Comments
(0)