forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit7332c3c
committed
Assert that we don't invent relfilenodes or type OIDs in binary upgrade.
During pg_upgrade's restore run, all relfilenode choices should beoverridden by commands in the dump script. If we ever find ourselveschoosing a relfilenode in the ordinary way, someone blew it. Likewise forpg_type OIDs. Since pg_upgrade might well succeed anyway, if there happensnot to be a conflict during the regression test run, we need assertionshere to keep us on the straight and narrow.We might someday be able to remove the assertion in GetNewRelFileNode,if pg_upgrade is rewritten to remove its assumption that old and newrelfilenodes always match. But it's hard to see how to get rid of thepg_type OID constraint, since those OIDs are embedded in user tablesin some cases.Back-patch as far as 9.5, because of the risk of back-patches breakingsomething here even if it works in HEAD. I'd prefer to go back further,but 9.4 fails both assertions due to get_rel_infos()'s use of a temporarytable. We can't use the later-branch solution of a CTE for compatibilityreasons (cf commit5d16332), and it doesn't seem worth inventing someother way to do the query. (I did check, by dint of changing the Assertsto elog(WARNING), that there are no other cases of unwanted OID assignmentsduring 9.4's regression test run.)Discussion:https://postgr.es/m/19785.1497215827@sss.pgh.pa.us1 parenta475e46 commit7332c3c
1 file changed
+16
-0
lines changedLines changed: 16 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
38 | 38 |
| |
39 | 39 |
| |
40 | 40 |
| |
| 41 | + | |
41 | 42 |
| |
42 | 43 |
| |
43 | 44 |
| |
| |||
340 | 341 |
| |
341 | 342 |
| |
342 | 343 |
| |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
343 | 352 |
| |
344 | 353 |
| |
345 | 354 |
| |
| |||
391 | 400 |
| |
392 | 401 |
| |
393 | 402 |
| |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
394 | 410 |
| |
395 | 411 |
| |
396 | 412 |
| |
|
0 commit comments
Comments
(0)