- Notifications
You must be signed in to change notification settings - Fork5
Commitb5565bc
committed
Fix failure of "ALTER TABLE t ADD COLUMN c serial" when done by non-owner.
The implicitly created sequence was created as owned by the current user,who could be different from the table owner, eg if current user is asuperuser or some member of the table's owning role. This caused sanitychecks in the SEQUENCE OWNED BY code to spit up. Although possibly wedon't need those sanity checks, the safest fix seems to be to make surethe implicit sequence is assigned the same owner role as the table has.(We still do all permissions checks as the current user, however.)Per report from Josh Berkus.Back-patch to 9.0. The bug goes back to the invention of SEQUENCE OWNED BYin 8.2, but the fix requires an API change for DefineRelation(), which seemsto have potential for breaking third-party code if done in a minor release.Given the lack of prior complaints, it's probably not worth fixing in thestable branches.1 parent99848ed commitb5565bc
File tree
11 files changed
+49
-18
lines changed- src
- backend
- commands
- nodes
- parser
- tcop
- include
- commands
- nodes
11 files changed
+49
-18
lines changedLines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
8 | 8 |
| |
9 | 9 |
| |
10 | 10 |
| |
11 |
| - | |
| 11 | + | |
12 | 12 |
| |
13 | 13 |
| |
14 | 14 |
| |
| |||
205 | 205 |
| |
206 | 206 |
| |
207 | 207 |
| |
208 |
| - | |
| 208 | + | |
209 | 209 |
| |
210 | 210 |
| |
211 | 211 |
| |
|
Lines changed: 17 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
8 | 8 |
| |
9 | 9 |
| |
10 | 10 |
| |
11 |
| - | |
| 11 | + | |
12 | 12 |
| |
13 | 13 |
| |
14 | 14 |
| |
| |||
341 | 341 |
| |
342 | 342 |
| |
343 | 343 |
| |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
344 | 354 |
| |
345 | 355 |
| |
346 | 356 |
| |
347 | 357 |
| |
348 |
| - | |
| 358 | + | |
349 | 359 |
| |
350 | 360 |
| |
351 | 361 |
| |
| |||
440 | 450 |
| |
441 | 451 |
| |
442 | 452 |
| |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
443 | 457 |
| |
444 | 458 |
| |
445 | 459 |
| |
| |||
532 | 546 |
| |
533 | 547 |
| |
534 | 548 |
| |
535 |
| - | |
| 549 | + | |
536 | 550 |
| |
537 | 551 |
| |
538 | 552 |
| |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
8 | 8 |
| |
9 | 9 |
| |
10 | 10 |
| |
11 |
| - | |
| 11 | + | |
12 | 12 |
| |
13 | 13 |
| |
14 | 14 |
| |
| |||
1548 | 1548 |
| |
1549 | 1549 |
| |
1550 | 1550 |
| |
1551 |
| - | |
| 1551 | + | |
1552 | 1552 |
| |
1553 | 1553 |
| |
1554 | 1554 |
| |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
8 | 8 |
| |
9 | 9 |
| |
10 | 10 |
| |
11 |
| - | |
| 11 | + | |
12 | 12 |
| |
13 | 13 |
| |
14 | 14 |
| |
| |||
242 | 242 |
| |
243 | 243 |
| |
244 | 244 |
| |
245 |
| - | |
| 245 | + | |
246 | 246 |
| |
247 | 247 |
| |
248 | 248 |
| |
|
Lines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
15 | 15 |
| |
16 | 16 |
| |
17 | 17 |
| |
18 |
| - | |
| 18 | + | |
19 | 19 |
| |
20 | 20 |
| |
21 | 21 |
| |
| |||
3023 | 3023 |
| |
3024 | 3024 |
| |
3025 | 3025 |
| |
| 3026 | + | |
3026 | 3027 |
| |
3027 | 3028 |
| |
3028 | 3029 |
| |
|
Lines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
22 | 22 |
| |
23 | 23 |
| |
24 | 24 |
| |
25 |
| - | |
| 25 | + | |
26 | 26 |
| |
27 | 27 |
| |
28 | 28 |
| |
| |||
1513 | 1513 |
| |
1514 | 1514 |
| |
1515 | 1515 |
| |
| 1516 | + | |
1516 | 1517 |
| |
1517 | 1518 |
| |
1518 | 1519 |
| |
|
Lines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
11 | 11 |
| |
12 | 12 |
| |
13 | 13 |
| |
14 |
| - | |
| 14 | + | |
15 | 15 |
| |
16 | 16 |
| |
17 | 17 |
| |
| |||
2827 | 2827 |
| |
2828 | 2828 |
| |
2829 | 2829 |
| |
| 2830 | + | |
2830 | 2831 |
| |
2831 | 2832 |
| |
2832 | 2833 |
| |
|
Lines changed: 13 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
19 | 19 |
| |
20 | 20 |
| |
21 | 21 |
| |
22 |
| - | |
| 22 | + | |
23 | 23 |
| |
24 | 24 |
| |
25 | 25 |
| |
| |||
361 | 361 |
| |
362 | 362 |
| |
363 | 363 |
| |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
364 | 376 |
| |
365 | 377 |
| |
366 | 378 |
| |
|
Lines changed: 3 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
10 | 10 |
| |
11 | 11 |
| |
12 | 12 |
| |
13 |
| - | |
| 13 | + | |
14 | 14 |
| |
15 | 15 |
| |
16 | 16 |
| |
| |||
510 | 510 |
| |
511 | 511 |
| |
512 | 512 |
| |
513 |
| - | |
| 513 | + | |
| 514 | + | |
514 | 515 |
| |
515 | 516 |
| |
516 | 517 |
| |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
7 | 7 |
| |
8 | 8 |
| |
9 | 9 |
| |
10 |
| - | |
| 10 | + | |
11 | 11 |
| |
12 | 12 |
| |
13 | 13 |
| |
| |||
19 | 19 |
| |
20 | 20 |
| |
21 | 21 |
| |
22 |
| - | |
| 22 | + | |
23 | 23 |
| |
24 | 24 |
| |
25 | 25 |
| |
|
Lines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
13 | 13 |
| |
14 | 14 |
| |
15 | 15 |
| |
16 |
| - | |
| 16 | + | |
17 | 17 |
| |
18 | 18 |
| |
19 | 19 |
| |
| |||
1700 | 1700 |
| |
1701 | 1701 |
| |
1702 | 1702 |
| |
| 1703 | + | |
1703 | 1704 |
| |
1704 | 1705 |
| |
1705 | 1706 |
| |
|
0 commit comments
Comments
(0)