- Notifications
You must be signed in to change notification settings - Fork28
Commitb5b0db1
committed
Fix handling of extended statistics during ALTER COLUMN TYPE.
ALTER COLUMN TYPE on a column used by a statistics object fails sincecommit928c4de, because the relevant switch in ATExecAlterColumnTypeis unprepared for columns to have dependencies from OCLASS_STATISTIC_EXTobjects.Although the existing types of extended statistics don't actually need usto do any work for a column type change, it seems completely indefensiblethat that assumption is hidden behind the failure of an unrelated moduleto contain any code for the case. Hence, create and call an API functionin statscmds.c where the assumption can be explained, and where we couldadd code to deal with the problem when it inevitably becomes real.Also, the reason this wasn't handled before, neither for extended statsnor for the last half-dozen new OCLASS kinds :-(, is that the default:in that switch suppresses compiler warnings, allowing people to miss theneed to consider it when adding an OCLASS. We don't really need a defaultbecause surely getObjectClass should only return valid values of the enum;so remove it, and add the missed OCLASS entries where they should be.Discussion:https://postgr.es/m/20170512221010.nglatgt5azzdxjlj@alvherre.pgsql1 parent65b655b commitb5b0db1
File tree
5 files changed
+88
-3
lines changed- src
- backend/commands
- include/commands
- test/regress
- expected
- sql
5 files changed
+88
-3
lines changedLines changed: 28 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
378 | 378 |
| |
379 | 379 |
| |
380 | 380 |
| |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + |
Lines changed: 21 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
9236 | 9236 |
| |
9237 | 9237 |
| |
9238 | 9238 |
| |
| 9239 | + | |
| 9240 | + | |
| 9241 | + | |
| 9242 | + | |
| 9243 | + | |
| 9244 | + | |
| 9245 | + | |
| 9246 | + | |
| 9247 | + | |
| 9248 | + | |
| 9249 | + | |
9239 | 9250 |
| |
9240 | 9251 |
| |
9241 | 9252 |
| |
| |||
9246 | 9257 |
| |
9247 | 9258 |
| |
9248 | 9259 |
| |
| 9260 | + | |
9249 | 9261 |
| |
9250 | 9262 |
| |
9251 | 9263 |
| |
| |||
9261 | 9273 |
| |
9262 | 9274 |
| |
9263 | 9275 |
| |
| 9276 | + | |
| 9277 | + | |
| 9278 | + | |
| 9279 | + | |
| 9280 | + | |
9264 | 9281 |
| |
9265 | 9282 |
| |
9266 | 9283 |
| |
| |||
9270 | 9287 |
| |
9271 | 9288 |
| |
9272 | 9289 |
| |
9273 |
| - | |
9274 |
| - | |
9275 |
| - | |
| 9290 | + | |
| 9291 | + | |
| 9292 | + | |
| 9293 | + | |
9276 | 9294 |
| |
9277 | 9295 |
| |
9278 | 9296 |
| |
|
Lines changed: 3 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
80 | 80 |
| |
81 | 81 |
| |
82 | 82 |
| |
| 83 | + | |
| 84 | + | |
| 85 | + | |
83 | 86 |
| |
84 | 87 |
| |
85 | 88 |
| |
|
Lines changed: 25 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
479 | 479 |
| |
480 | 480 |
| |
481 | 481 |
| |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
482 | 507 |
|
Lines changed: 11 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
266 | 266 |
| |
267 | 267 |
| |
268 | 268 |
| |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
269 | 280 |
| |
270 | 281 |
| |
271 | 282 |
| |
|
0 commit comments
Comments
(0)