Commit a3c9d35
committed
Reject attempts to alter composite types used in indexes.
find_composite_type_dependencies() ignored indexes, which is a poor
decision because an expression index could have a stored column of
a composite (or other container) type even when the underlying table
does not. Teach it to detect such cases and error out. We have to
work a bit harder than for other relations because the pg_depend entry
won't identify the specific index column of concern, but it's not much
new code.
This does not address bug #17872's original complaint that dropping
a column in such a type might lead to violations of the uniqueness
property that a unique index is supposed to ensure. That seems of
much less concern to me because it won't lead to crashes.
Per bug #17872 from Alexander Lakhin. Back-patch to all supported
branches.
Discussion: https://postgr.es/m/17872-d0fbb799dc3fd85d@postgresql.org1 parent c87aff0 commit a3c9d35
File tree
3 files changed
+67
-10
lines changed- src
- backend/commands
- test/regress
- expected
- sql
3 files changed
+67
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6508 | 6508 | | |
6509 | 6509 | | |
6510 | 6510 | | |
| 6511 | + | |
6511 | 6512 | | |
6512 | 6513 | | |
6513 | 6514 | | |
| |||
6524 | 6525 | | |
6525 | 6526 | | |
6526 | 6527 | | |
6527 | | - | |
6528 | | - | |
6529 | | - | |
6530 | | - | |
| 6528 | + | |
| 6529 | + | |
6531 | 6530 | | |
6532 | 6531 | | |
6533 | 6532 | | |
6534 | | - | |
| 6533 | + | |
6535 | 6534 | | |
6536 | | - | |
6537 | | - | |
6538 | | - | |
| 6535 | + | |
| 6536 | + | |
| 6537 | + | |
| 6538 | + | |
| 6539 | + | |
| 6540 | + | |
| 6541 | + | |
| 6542 | + | |
| 6543 | + | |
| 6544 | + | |
| 6545 | + | |
| 6546 | + | |
| 6547 | + | |
| 6548 | + | |
| 6549 | + | |
| 6550 | + | |
| 6551 | + | |
| 6552 | + | |
| 6553 | + | |
| 6554 | + | |
| 6555 | + | |
| 6556 | + | |
| 6557 | + | |
| 6558 | + | |
| 6559 | + | |
| 6560 | + | |
| 6561 | + | |
| 6562 | + | |
| 6563 | + | |
| 6564 | + | |
| 6565 | + | |
| 6566 | + | |
| 6567 | + | |
| 6568 | + | |
| 6569 | + | |
| 6570 | + | |
| 6571 | + | |
| 6572 | + | |
| 6573 | + | |
| 6574 | + | |
| 6575 | + | |
| 6576 | + | |
| 6577 | + | |
| 6578 | + | |
6539 | 6579 | | |
6540 | 6580 | | |
6541 | 6581 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3097 | 3097 | | |
3098 | 3098 | | |
3099 | 3099 | | |
| 3100 | + | |
| 3101 | + | |
| 3102 | + | |
| 3103 | + | |
| 3104 | + | |
| 3105 | + | |
| 3106 | + | |
3100 | 3107 | | |
3101 | 3108 | | |
3102 | 3109 | | |
| |||
3208 | 3215 | | |
3209 | 3216 | | |
3210 | 3217 | | |
3211 | | - | |
| 3218 | + | |
| 3219 | + | |
3212 | 3220 | | |
3213 | 3221 | | |
3214 | 3222 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1983 | 1983 | | |
1984 | 1984 | | |
1985 | 1985 | | |
| 1986 | + | |
| 1987 | + | |
| 1988 | + | |
| 1989 | + | |
| 1990 | + | |
| 1991 | + | |
| 1992 | + | |
| 1993 | + | |
1986 | 1994 | | |
1987 | 1995 | | |
1988 | 1996 | | |
| |||
2010 | 2018 | | |
2011 | 2019 | | |
2012 | 2020 | | |
2013 | | - | |
| 2021 | + | |
| 2022 | + | |
2014 | 2023 | | |
2015 | 2024 | | |
2016 | 2025 | | |
| |||
0 commit comments