- Notifications
You must be signed in to change notification settings - Fork5
Commit15bc038
committed
Relax transactional restrictions on ALTER TYPE ... ADD VALUE.
To prevent possibly breaking indexes on enum columns, we must keepuncommitted enum values from getting stored in tables, unless wecan be sure that any such column is new in the current transaction.Formerly, we enforced this by disallowing ALTER TYPE ... ADD VALUEfrom being executed at all in a transaction block, unless the targetenum type had been created in the current transaction. This patchremoves that restriction, and instead insists that an uncommitted enumvalue can't be referenced unless it belongs to an enum type createdin the same transaction as the value. Per discussion, this should bea bit less onerous. It does require each function that could possiblyreturn a new enum value to SQL operations to check this restriction,but there aren't so many of those that this seems unmaintainable.Andrew Dunstan and Tom LaneDiscussion: <4075.1459088427@sss.pgh.pa.us>1 parent016abf1 commit15bc038
File tree
8 files changed
+191
-40
lines changed- doc/src/sgml/ref
- src
- backend
- commands
- tcop
- utils
- adt
- include/commands
- test/regress
- expected
- sql
8 files changed
+191
-40
lines changedLines changed: 4 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
266 | 266 |
| |
267 | 267 |
| |
268 | 268 |
| |
269 |
| - | |
270 |
| - | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
271 | 273 |
| |
272 | 274 |
| |
273 | 275 |
| |
|
Lines changed: 1 addition & 20 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1221 | 1221 |
| |
1222 | 1222 |
| |
1223 | 1223 |
| |
1224 |
| - | |
| 1224 | + | |
1225 | 1225 |
| |
1226 | 1226 |
| |
1227 | 1227 |
| |
| |||
1236 | 1236 |
| |
1237 | 1237 |
| |
1238 | 1238 |
| |
1239 |
| - | |
1240 |
| - | |
1241 |
| - | |
1242 |
| - | |
1243 |
| - | |
1244 |
| - | |
1245 |
| - | |
1246 |
| - | |
1247 |
| - | |
1248 |
| - | |
1249 |
| - | |
1250 |
| - | |
1251 |
| - | |
1252 |
| - | |
1253 |
| - | |
1254 |
| - | |
1255 |
| - | |
1256 |
| - | |
1257 |
| - | |
1258 | 1239 |
| |
1259 | 1240 |
| |
1260 | 1241 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1359 | 1359 |
| |
1360 | 1360 |
| |
1361 | 1361 |
| |
1362 |
| - | |
| 1362 | + | |
1363 | 1363 |
| |
1364 | 1364 |
| |
1365 | 1365 |
| |
|
Lines changed: 104 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
19 | 19 |
| |
20 | 20 |
| |
21 | 21 |
| |
| 22 | + | |
22 | 23 |
| |
23 | 24 |
| |
24 | 25 |
| |
| |||
31 | 32 |
| |
32 | 33 |
| |
33 | 34 |
| |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
34 | 122 |
| |
35 | 123 |
| |
36 | 124 |
| |
| |||
59 | 147 |
| |
60 | 148 |
| |
61 | 149 |
| |
| 150 | + | |
| 151 | + | |
| 152 | + | |
62 | 153 |
| |
63 | 154 |
| |
64 | 155 |
| |
| |||
124 | 215 |
| |
125 | 216 |
| |
126 | 217 |
| |
| 218 | + | |
| 219 | + | |
| 220 | + | |
127 | 221 |
| |
128 | 222 |
| |
129 | 223 |
| |
| |||
327 | 421 |
| |
328 | 422 |
| |
329 | 423 |
| |
| 424 | + | |
| 425 | + | |
| 426 | + | |
330 | 427 |
| |
| 428 | + | |
331 | 429 |
| |
| 430 | + | |
| 431 | + | |
332 | 432 |
| |
| 433 | + | |
333 | 434 |
| |
334 | 435 |
| |
335 | 436 |
| |
| |||
490 | 591 |
| |
491 | 592 |
| |
492 | 593 |
| |
| 594 | + | |
| 595 | + | |
| 596 | + | |
493 | 597 |
| |
494 | 598 |
| |
495 | 599 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
398 | 398 |
| |
399 | 399 |
| |
400 | 400 |
| |
| 401 | + | |
401 | 402 |
| |
402 | 403 |
| |
403 | 404 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
26 | 26 |
| |
27 | 27 |
| |
28 | 28 |
| |
29 |
| - | |
| 29 | + | |
30 | 30 |
| |
31 | 31 |
| |
32 | 32 |
| |
|
Lines changed: 56 additions & 9 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
560 | 560 |
| |
561 | 561 |
| |
562 | 562 |
| |
563 |
| - | |
| 563 | + | |
| 564 | + | |
564 | 565 |
| |
565 |
| - | |
566 |
| - | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
567 | 588 |
| |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
568 | 605 |
| |
569 |
| - | |
| 606 | + | |
570 | 607 |
| |
571 | 608 |
| |
572 | 609 |
| |
573 |
| - | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
574 | 615 |
| |
575 | 616 |
| |
576 |
| - | |
577 |
| - | |
| 617 | + | |
| 618 | + | |
578 | 619 |
| |
579 |
| - | |
580 |
| - | |
| 620 | + | |
| 621 | + | |
581 | 622 |
| |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
582 | 629 |
| |
583 | 630 |
| |
584 | 631 |
| |
|
Lines changed: 23 additions & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
262 | 262 |
| |
263 | 263 |
| |
264 | 264 |
| |
265 |
| - | |
| 265 | + | |
| 266 | + | |
266 | 267 |
| |
267 |
| - | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
268 | 277 |
| |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
269 | 283 |
| |
270 | 284 |
| |
271 |
| - | |
| 285 | + | |
272 | 286 |
| |
273 | 287 |
| |
274 | 288 |
| |
| 289 | + | |
275 | 290 |
| |
276 | 291 |
| |
277 | 292 |
| |
278 | 293 |
| |
279 |
| - | |
280 |
| - | |
| 294 | + | |
| 295 | + | |
281 | 296 |
| |
282 |
| - | |
283 |
| - | |
| 297 | + | |
| 298 | + | |
284 | 299 |
| |
| 300 | + | |
285 | 301 |
| |
286 | 302 |
| |
287 | 303 |
| |
|
0 commit comments
Comments
(0)