forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit4ab5dae
committed
Use TRUNCATE to preserve relfilenode for pg_largeobject + index.
Commit9a974cb arranged to preservethe relfilenode of user tables across pg_upgrade, but failed to noticethat pg_upgrade treats pg_largeobject as a user table and thus it needsthe same treatment. Otherwise, large objects will appear to vanishafter a pg_upgrade.Commitd498e05 fixed this problemby teaching pg_dump to UPDATE pg_class.relfilenode for pg_largeobjectand its index. However, because an UPDATE on the catalog rows doesn'tchange anything on disk, this can leave stray files behind in the newcluster. They will normally be empty, but it's a little bit untidy.Hence, this commit arranges to do the same thing using DDL. Specifically,it makes TRUNCATE work for the pg_largeobject catalog when inbinary-upgrade mode, and it then uses that command in binary-upgradedumps as a way of setting pg_class.relfilenode for pg_largeobject andits index. That way, the old files are removed from the new cluster.Discussion:http://postgr.es/m/CA+TgmoYYMXGUJO5GZk1-MByJGu_bB8CbOL6GJQC8=Bzt6x6vDg@mail.gmail.com1 parent02e5c27 commit4ab5dae
File tree
4 files changed
+120
-15
lines changed- src
- backend
- commands
- storage/smgr
- utils/cache
- bin/pg_dump
4 files changed
+120
-15
lines changedLines changed: 10 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
40 | 40 |
| |
41 | 41 |
| |
42 | 42 |
| |
| 43 | + | |
43 | 44 |
| |
44 | 45 |
| |
45 | 46 |
| |
| |||
2181 | 2182 |
| |
2182 | 2183 |
| |
2183 | 2184 |
| |
2184 |
| - | |
| 2185 | + | |
| 2186 | + | |
| 2187 | + | |
| 2188 | + | |
| 2189 | + | |
| 2190 | + | |
| 2191 | + | |
| 2192 | + | |
| 2193 | + | |
2185 | 2194 |
| |
2186 | 2195 |
| |
2187 | 2196 |
| |
|
Lines changed: 22 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
319 | 319 |
| |
320 | 320 |
| |
321 | 321 |
| |
| 322 | + | |
322 | 323 |
| |
323 | 324 |
| |
324 | 325 |
| |
| |||
353 | 354 |
| |
354 | 355 |
| |
355 | 356 |
| |
356 |
| - | |
357 |
| - | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
358 | 373 |
| |
359 | 374 |
| |
360 | 375 |
| |
| |||
363 | 378 |
| |
364 | 379 |
| |
365 | 380 |
| |
366 |
| - | |
367 | 381 |
| |
368 | 382 |
| |
369 | 383 |
| |
370 | 384 |
| |
371 | 385 |
| |
372 |
| - | |
| 386 | + | |
373 | 387 |
| |
374 |
| - | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
375 | 392 |
| |
376 | 393 |
| |
377 | 394 |
| |
|
Lines changed: 61 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
41 | 41 |
| |
42 | 42 |
| |
43 | 43 |
| |
| 44 | + | |
44 | 45 |
| |
45 | 46 |
| |
46 | 47 |
| |
| |||
3707 | 3708 |
| |
3708 | 3709 |
| |
3709 | 3710 |
| |
3710 |
| - | |
3711 |
| - | |
3712 |
| - | |
| 3711 | + | |
| 3712 | + | |
| 3713 | + | |
| 3714 | + | |
| 3715 | + | |
| 3716 | + | |
| 3717 | + | |
| 3718 | + | |
| 3719 | + | |
| 3720 | + | |
| 3721 | + | |
| 3722 | + | |
| 3723 | + | |
| 3724 | + | |
| 3725 | + | |
| 3726 | + | |
| 3727 | + | |
| 3728 | + | |
| 3729 | + | |
| 3730 | + | |
| 3731 | + | |
| 3732 | + | |
| 3733 | + | |
| 3734 | + | |
| 3735 | + | |
| 3736 | + | |
| 3737 | + | |
| 3738 | + | |
| 3739 | + | |
| 3740 | + | |
3713 | 3741 |
| |
3714 | 3742 |
| |
3715 | 3743 |
| |
| |||
3724 | 3752 |
| |
3725 | 3753 |
| |
3726 | 3754 |
| |
3727 |
| - | |
| 3755 | + | |
| 3756 | + | |
3728 | 3757 |
| |
3729 |
| - | |
| 3758 | + | |
| 3759 | + | |
| 3760 | + | |
| 3761 | + | |
| 3762 | + | |
| 3763 | + | |
| 3764 | + | |
| 3765 | + | |
| 3766 | + | |
| 3767 | + | |
| 3768 | + | |
| 3769 | + | |
| 3770 | + | |
| 3771 | + | |
| 3772 | + | |
| 3773 | + | |
| 3774 | + | |
| 3775 | + | |
| 3776 | + | |
| 3777 | + | |
| 3778 | + | |
| 3779 | + | |
| 3780 | + | |
| 3781 | + | |
| 3782 | + | |
| 3783 | + | |
| 3784 | + | |
| 3785 | + | |
3730 | 3786 |
| |
3731 | 3787 |
| |
3732 | 3788 |
| |
|
Lines changed: 27 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3141 | 3141 |
| |
3142 | 3142 |
| |
3143 | 3143 |
| |
| 3144 | + | |
3144 | 3145 |
| |
3145 | 3146 |
| |
3146 | 3147 |
| |
| |||
3167 | 3168 |
| |
3168 | 3169 |
| |
3169 | 3170 |
| |
3170 |
| - | |
| 3171 | + | |
| 3172 | + | |
3171 | 3173 |
| |
| 3174 | + | |
| 3175 | + | |
| 3176 | + | |
| 3177 | + | |
3172 | 3178 |
| |
3173 |
| - | |
| 3179 | + | |
3174 | 3180 |
| |
3175 | 3181 |
| |
3176 | 3182 |
| |
3177 |
| - | |
3178 |
| - | |
| 3183 | + | |
| 3184 | + | |
| 3185 | + | |
| 3186 | + | |
| 3187 | + | |
| 3188 | + | |
| 3189 | + | |
| 3190 | + | |
| 3191 | + | |
| 3192 | + | |
| 3193 | + | |
| 3194 | + | |
| 3195 | + | |
| 3196 | + | |
| 3197 | + | |
| 3198 | + | |
| 3199 | + | |
| 3200 | + | |
3179 | 3201 |
| |
3180 | 3202 |
| |
3181 | 3203 |
| |
| |||
3187 | 3209 |
| |
3188 | 3210 |
| |
3189 | 3211 |
| |
| 3212 | + | |
3190 | 3213 |
| |
3191 | 3214 |
| |
3192 | 3215 |
| |
|
0 commit comments
Comments
(0)