forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit0ccfc28
committed
Check for tables with sql_identifier during pg_upgrade
Commit7c15cef changed sql_identifier data type to be based on nameinstead of varchar. Unfortunately, this breaks on-disk format for thisdata type. Luckily, that should be a very rare problem, as this datatype is used only in information_schema views, so this only affects userobjects (tables, materialized views and indexes). One way to end insuch situation is to do CTAS with a query on those system views.There are two options to deal with this - we can either abort pg_upgradeif there are user objects with sql_identifier columns in pg_upgrade, orwe could replace the sql_identifier type with varchar. Considering howrare the issue is expected to be, and the complexity of replacing thedata type (e.g. in matviews), we've decided to go with the simple check.The query is somewhat complex - the sql_identifier data type may be usedindirectly - through a domain, a composite type or both, possibly inmultiple levels. Detecting this requires a recursive CTE.Backpatch to 12, where the sql_identifier definition changed.Reported-by: Hans BuschmannAuthor: Tomas VondraReviewed-by: Tom LaneBackpatch-to: 12Discussion:https://postgr.es/m/16045-673e8fa6b5ace196%40postgresql.org1 parent14ac423 commit0ccfc28
3 files changed
+129
-0
lines changedLines changed: 8 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
108 | 108 |
| |
109 | 109 |
| |
110 | 110 |
| |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
111 | 119 |
| |
112 | 120 |
| |
113 | 121 |
| |
|
Lines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
451 | 451 |
| |
452 | 452 |
| |
453 | 453 |
| |
| 454 | + | |
| 455 | + | |
454 | 456 |
| |
455 | 457 |
| |
456 | 458 |
| |
|
Lines changed: 119 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
399 | 399 |
| |
400 | 400 |
| |
401 | 401 |
| |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + |
0 commit comments
Comments
(0)