forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitc92be3c
committed
Avoid pre-determining index names during CREATE TABLE LIKE parsing.
Formerly, when trying to copy both indexes and comments, CREATE TABLE LIKEhad to pre-assign names to indexes that had comments, because it made up anexplicit CommentStmt command to apply the comment and so it had to know thename for the index. This creates bad interactions with other indexes, asshown in bug #6734 from Daniele Varrazzo: the preassignment logic couldn'ttake any other indexes into account so it could choose a conflicting name.To fix, add a field to IndexStmt that allows it to carry a comment to beassigned to the new index. (This isn't a user-exposed feature of CREATEINDEX, only an internal option.) Now we don't need preassignment of indexnames in any situation.I also took the opportunity to refactor DefineIndex to accept the IndexStmtas such, rather than passing all its fields individually in a mile-longparameter list.Back-patch to 9.2, but no further, because it seems too dangerous to changeIndexStmt or DefineIndex's API in released branches. The bug exists backto 9.0 where CREATE TABLE LIKE grew the ability to copy comments, but giventhe lack of prior complaints we'll just let it go unfixed before 9.2.1 parent54fd196 commitc92be3c
File tree
11 files changed
+147
-204
lines changed- src
- backend
- bootstrap
- commands
- nodes
- parser
- tcop
- include
- commands
- nodes
11 files changed
+147
-204
lines changedLines changed: 50 additions & 18 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
279 | 279 |
| |
280 | 280 |
| |
281 | 281 |
| |
| 282 | + | |
| 283 | + | |
282 | 284 |
| |
283 | 285 |
| |
284 |
| - | |
285 |
| - | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
286 | 305 |
| |
287 |
| - | |
288 |
| - | |
289 |
| - | |
290 |
| - | |
291 |
| - | |
292 |
| - | |
293 |
| - | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
294 | 310 |
| |
295 | 311 |
| |
296 | 312 |
| |
297 | 313 |
| |
298 | 314 |
| |
299 | 315 |
| |
300 | 316 |
| |
| 317 | + | |
| 318 | + | |
301 | 319 |
| |
302 | 320 |
| |
303 |
| - | |
304 |
| - | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
305 | 340 |
| |
306 |
| - | |
307 |
| - | |
308 |
| - | |
309 |
| - | |
310 |
| - | |
311 |
| - | |
312 |
| - | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
313 | 345 |
| |
314 | 346 |
| |
315 | 347 |
| |
|
0 commit comments
Comments
(0)