- Notifications
You must be signed in to change notification settings - Fork5.2k
Commit0decd5e
committed
Sort dump objects independent of OIDs, for the 7 holdout object types.
pg_dump sorts objects by their logical names, e.g. (nspname, relname,tgname), before dependency-driven reordering. That removes one sourceof logically-identical databases differing in their schema-only dumps.In other words, it helps with schema diffing. The logical name sortignored essential sort keys for constraints, operators, PUBLICATION... FOR TABLE, PUBLICATION ... FOR TABLES IN SCHEMA, operator classes,and operator families. pg_dump's sort then depended on object OID,yielding spurious schema diffs. After this change, OIDs affect dumporder only in the event of catalog corruption. While pg_dump alsowrongly ignored pg_collation.collencoding, CREATE COLLATION restrictionshave been keeping that imperceptible in practical use.Use techniques like we use for object types already having full sort keycoverage. Where the pertinent queries weren't fetching the ignored sortkeys, this adds columns to those queries and stores those keys in memoryfor the long term.The ignorance of sort keys became more problematic when commit172259a added a schema diff testsensitive to it. Buildfarm member hippopotamus witnessed that.However, dump order stability isn't a new goal, and this might avoidother dump comparison failures. Hence, back-patch to v13 (all supportedversions).Reviewed-by: Robert Haas <robertmhaas@gmail.com>Discussion:https://postgr.es/m/20250707192654.9e.nmisch@google.comBackpatch-through: 131 parent3357471 commit0decd5e
File tree
6 files changed
+335
-30
lines changed- src
- bin/pg_dump
- test/regress
- expected
- sql
6 files changed
+335
-30
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
944 | 945 | | |
945 | 946 | | |
946 | 947 | | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
947 | 966 | | |
948 | 967 | | |
949 | 968 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2207 | 2207 | | |
2208 | 2208 | | |
2209 | 2209 | | |
| 2210 | + | |
| 2211 | + | |
| 2212 | + | |
| 2213 | + | |
| 2214 | + | |
| 2215 | + | |
| 2216 | + | |
2210 | 2217 | | |
2211 | 2218 | | |
2212 | 2219 | | |
| |||
6262 | 6269 | | |
6263 | 6270 | | |
6264 | 6271 | | |
| 6272 | + | |
| 6273 | + | |
6265 | 6274 | | |
6266 | 6275 | | |
6267 | 6276 | | |
| |||
6273 | 6282 | | |
6274 | 6283 | | |
6275 | 6284 | | |
| 6285 | + | |
| 6286 | + | |
6276 | 6287 | | |
6277 | 6288 | | |
6278 | 6289 | | |
| |||
6288 | 6299 | | |
6289 | 6300 | | |
6290 | 6301 | | |
| 6302 | + | |
| 6303 | + | |
6291 | 6304 | | |
6292 | 6305 | | |
6293 | 6306 | | |
| |||
6301 | 6314 | | |
6302 | 6315 | | |
6303 | 6316 | | |
| 6317 | + | |
| 6318 | + | |
6304 | 6319 | | |
6305 | 6320 | | |
6306 | 6321 | | |
| |||
6329 | 6344 | | |
6330 | 6345 | | |
6331 | 6346 | | |
| 6347 | + | |
6332 | 6348 | | |
6333 | 6349 | | |
6334 | 6350 | | |
| |||
6339 | 6355 | | |
6340 | 6356 | | |
6341 | 6357 | | |
6342 | | - | |
| 6358 | + | |
| 6359 | + | |
6343 | 6360 | | |
6344 | 6361 | | |
6345 | 6362 | | |
| |||
6353 | 6370 | | |
6354 | 6371 | | |
6355 | 6372 | | |
| 6373 | + | |
6356 | 6374 | | |
6357 | 6375 | | |
6358 | 6376 | | |
| |||
6364 | 6382 | | |
6365 | 6383 | | |
6366 | 6384 | | |
| 6385 | + | |
6367 | 6386 | | |
6368 | 6387 | | |
6369 | 6388 | | |
| |||
6454 | 6473 | | |
6455 | 6474 | | |
6456 | 6475 | | |
6457 | | - | |
6458 | | - | |
6459 | | - | |
6460 | | - | |
6461 | 6476 | | |
6462 | 6477 | | |
6463 | | - | |
6464 | | - | |
6465 | | - | |
6466 | | - | |
| 6478 | + | |
| 6479 | + | |
| 6480 | + | |
| 6481 | + | |
| 6482 | + | |
| 6483 | + | |
| 6484 | + | |
| 6485 | + | |
| 6486 | + | |
| 6487 | + | |
| 6488 | + | |
| 6489 | + | |
| 6490 | + | |
| 6491 | + | |
| 6492 | + | |
| 6493 | + | |
| 6494 | + | |
| 6495 | + | |
| 6496 | + | |
| 6497 | + | |
6467 | 6498 | | |
6468 | 6499 | | |
6469 | 6500 | | |
| |||
6512 | 6543 | | |
6513 | 6544 | | |
6514 | 6545 | | |
| 6546 | + | |
6515 | 6547 | | |
6516 | 6548 | | |
6517 | 6549 | | |
| |||
6521 | 6553 | | |
6522 | 6554 | | |
6523 | 6555 | | |
6524 | | - | |
| 6556 | + | |
6525 | 6557 | | |
6526 | 6558 | | |
6527 | 6559 | | |
| |||
6534 | 6566 | | |
6535 | 6567 | | |
6536 | 6568 | | |
| 6569 | + | |
6537 | 6570 | | |
6538 | 6571 | | |
6539 | 6572 | | |
| |||
6547 | 6580 | | |
6548 | 6581 | | |
6549 | 6582 | | |
| 6583 | + | |
6550 | 6584 | | |
6551 | 6585 | | |
6552 | 6586 | | |
| |||
6572 | 6606 | | |
6573 | 6607 | | |
6574 | 6608 | | |
| 6609 | + | |
6575 | 6610 | | |
6576 | 6611 | | |
6577 | 6612 | | |
| |||
6583 | 6618 | | |
6584 | 6619 | | |
6585 | 6620 | | |
6586 | | - | |
| 6621 | + | |
6587 | 6622 | | |
6588 | 6623 | | |
6589 | 6624 | | |
| |||
6597 | 6632 | | |
6598 | 6633 | | |
6599 | 6634 | | |
| 6635 | + | |
6600 | 6636 | | |
6601 | 6637 | | |
6602 | 6638 | | |
| |||
6609 | 6645 | | |
6610 | 6646 | | |
6611 | 6647 | | |
| 6648 | + | |
6612 | 6649 | | |
6613 | 6650 | | |
6614 | 6651 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
260 | 260 | | |
261 | 261 | | |
262 | 262 | | |
| 263 | + | |
| 264 | + | |
263 | 265 | | |
264 | 266 | | |
265 | 267 | | |
| |||
273 | 275 | | |
274 | 276 | | |
275 | 277 | | |
| 278 | + | |
276 | 279 | | |
277 | 280 | | |
278 | 281 | | |
279 | 282 | | |
280 | 283 | | |
281 | 284 | | |
| 285 | + | |
282 | 286 | | |
283 | 287 | | |
284 | 288 | | |
285 | 289 | | |
286 | 290 | | |
287 | 291 | | |
288 | 292 | | |
| 293 | + | |
289 | 294 | | |
290 | 295 | | |
291 | 296 | | |
| |||
760 | 765 | | |
761 | 766 | | |
762 | 767 | | |
| 768 | + | |
763 | 769 | | |
764 | 770 | | |
765 | 771 | | |
| |||
0 commit comments
Comments
(0)