forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitfdd8857
committed
Block ALTER INDEX/TABLE index_name ALTER COLUMN colname SET (options)
The grammar of this command run on indexes with column names has alwaysbeen authorized by the parser, and it has never been documented.Since911e702, it is possible to define opclass parameters as of CREATEINDEX, which actually broke the old case of ALTER INDEX/TABLE whererelation-level parameters n_distinct and n_distinct_inherited could bedefined for an index (see76a47c0 and its thread where this point hasbeen touched, still remained unused). Attempting to do that in v13~would cause the index to become unusable, as there is a new dedicatedcode path to load opclass parameters instead of the relation-level onespreviously available. Note that it is possible to fix things with amanual catalog update to bring the relation back online.This commit disables this command for now as the use of column names forindexes does not make sense anyway, particularly when it comes to indexexpressions where names are automatically computed. One way to properlysupport this case properly in the future would be to use column numberswhen it comes to indexes, in the same way as ALTER INDEX .. ALTER COLUMN.. SET STATISTICS.Partitioned indexes were already blocked, but not indexes. Some testsare added for both cases.There was some code in ANALYZE to enforce n_distinct to be used for anindex expression if the parameter was defined, but just remove it fornow until/if there is support for this (note that index-level parametersnever had support in pg_dump either, previously), so this was just deadcode.Reported-by: Matthijs van der VleutenAuthor: Nathan Bossart, Michael PaquierReviewed-by: Vik Fearing, Dilip KumarDiscussion:https://postgr.es/m/17220-15d684c6c2171a83@postgresql.orgBackpatch-through: 131 parentd6f1e16 commitfdd8857
File tree
4 files changed
+26
-12
lines changed- src
- backend/commands
- test/regress
- expected
- sql
4 files changed
+26
-12
lines changedLines changed: 0 additions & 11 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
965 | 965 |
| |
966 | 966 |
| |
967 | 967 |
| |
968 |
| - | |
969 |
| - | |
970 |
| - | |
971 | 968 |
| |
972 | 969 |
| |
973 | 970 |
| |
| |||
977 | 974 |
| |
978 | 975 |
| |
979 | 976 |
| |
980 |
| - | |
981 |
| - | |
982 |
| - | |
983 |
| - | |
984 |
| - | |
985 |
| - | |
986 |
| - | |
987 |
| - | |
988 | 977 |
| |
989 | 978 |
| |
990 | 979 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4494 | 4494 |
| |
4495 | 4495 |
| |
4496 | 4496 |
| |
4497 |
| - | |
| 4497 | + | |
4498 | 4498 |
| |
4499 | 4499 |
| |
4500 | 4500 |
| |
|
Lines changed: 14 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
329 | 329 |
| |
330 | 330 |
| |
331 | 331 |
| |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + |
Lines changed: 11 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
172 | 172 |
| |
173 | 173 |
| |
174 | 174 |
| |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + |
0 commit comments
Comments
(0)