- Notifications
You must be signed in to change notification settings - Fork5
Commit4317e02
committed
Rewrite --section option to decouple it from --schema-only/--data-only.
The initial implementation of pg_dump's --section option supposed that theexisting --schema-only and --data-only options could be made equivalent to--section settings. This is wrong, though, due to dubious but long sinceset-in-stone decisions about where to dump SEQUENCE SET items, as seen inbug report from Martin Pitt. (And I'm not totally convinced there weren'tother bugs, either.) Undo that coupling and instead drive --sectionfiltering off current-section state tracked as we scan through the TOClist to call _tocEntryRequired().To make sure those decisions don't shift around and hopefully save a fewcycles, run _tocEntryRequired() only once per TOC entry and save the resultin a new TOC field. This required minor rejiggering of ACL handling butalso allows a far cleaner implementation of inhibit_data_for_failed_table.Also, to ensure that pg_dump and pg_restore have the same behavior withrespect to the --section switches, add _tocEntryRequired() filtering toWriteToc() and WriteDataChunks(), rather than trying to implement sectionfiltering in an entirely orthogonal way in dumpDumpableObject(). Thisrequired adjusting the handling of the special ENCODING and STDSTRINGSitems, but they were pretty weird before anyway.Minor other code review for the patch, too.1 parent4bc6fb5 commit4317e02
File tree
10 files changed
+238
-238
lines changed- doc/src/sgml/ref
- src/bin/pg_dump
10 files changed
+238
-238
lines changedLines changed: 22 additions & 11 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
113 | 113 |
| |
114 | 114 |
| |
115 | 115 |
| |
| 116 | + | |
116 | 117 |
| |
117 | 118 |
| |
118 | 119 |
| |
119 |
| - | |
| 120 | + | |
| 121 | + | |
120 | 122 |
| |
121 | 123 |
| |
122 | 124 |
| |
| |||
403 | 405 |
| |
404 | 406 |
| |
405 | 407 |
| |
406 |
| - | |
407 |
| - | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
408 | 412 |
| |
409 | 413 |
| |
410 |
| - | |
411 |
| - | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
412 | 420 |
| |
413 | 421 |
| |
414 | 422 |
| |
| |||
722 | 730 |
| |
723 | 731 |
| |
724 | 732 |
| |
725 |
| - | |
726 |
| - | |
727 |
| - | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
728 | 737 |
| |
729 | 738 |
| |
730 |
| - | |
731 |
| - | |
732 |
| - | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
733 | 744 |
| |
734 | 745 |
| |
735 | 746 |
| |
|
Lines changed: 23 additions & 12 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
92 | 92 |
| |
93 | 93 |
| |
94 | 94 |
| |
| 95 | + | |
| 96 | + | |
95 | 97 |
| |
| 98 | + | |
96 | 99 |
| |
97 |
| - | |
| 100 | + | |
| 101 | + | |
98 | 102 |
| |
99 | 103 |
| |
100 | 104 |
| |
| |||
357 | 361 |
| |
358 | 362 |
| |
359 | 363 |
| |
360 |
| - | |
361 |
| - | |
362 |
| - | |
363 |
| - | |
| 364 | + | |
| 365 | + | |
364 | 366 |
| |
365 | 367 |
| |
366 |
| - | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
367 | 371 |
| |
368 | 372 |
| |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
369 | 377 |
| |
370 | 378 |
| |
371 | 379 |
| |
| |||
515 | 523 |
| |
516 | 524 |
| |
517 | 525 |
| |
518 |
| - | |
519 |
| - | |
520 |
| - | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
521 | 530 |
| |
522 | 531 |
| |
523 |
| - | |
524 |
| - | |
525 |
| - | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
526 | 537 |
| |
527 | 538 |
| |
528 | 539 |
| |
|
Lines changed: 31 additions & 30 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
17 | 17 |
| |
18 | 18 |
| |
19 | 19 |
| |
20 |
| - | |
21 | 20 |
| |
22 | 21 |
| |
23 | 22 |
| |
| |||
1230 | 1229 |
| |
1231 | 1230 |
| |
1232 | 1231 |
| |
| 1232 | + | |
| 1233 | + | |
| 1234 | + | |
| 1235 | + | |
| 1236 | + | |
| 1237 | + | |
| 1238 | + | |
| 1239 | + | |
| 1240 | + | |
| 1241 | + | |
| 1242 | + | |
| 1243 | + | |
| 1244 | + | |
| 1245 | + | |
| 1246 | + | |
| 1247 | + | |
| 1248 | + | |
| 1249 | + | |
| 1250 | + | |
| 1251 | + | |
| 1252 | + | |
| 1253 | + | |
| 1254 | + | |
| 1255 | + | |
| 1256 | + | |
| 1257 | + | |
| 1258 | + | |
| 1259 | + | |
| 1260 | + | |
| 1261 | + | |
| 1262 | + | |
1233 | 1263 |
| |
1234 | 1264 |
| |
1235 | 1265 |
| |
| |||
1279 | 1309 |
| |
1280 | 1310 |
| |
1281 | 1311 |
| |
1282 |
| - | |
1283 |
| - | |
1284 |
| - | |
1285 |
| - | |
1286 |
| - | |
1287 |
| - | |
1288 |
| - | |
1289 |
| - | |
1290 |
| - | |
1291 |
| - | |
1292 |
| - | |
1293 |
| - | |
1294 |
| - | |
1295 |
| - | |
1296 |
| - | |
1297 |
| - | |
1298 |
| - | |
1299 |
| - | |
1300 |
| - | |
1301 |
| - | |
1302 |
| - | |
1303 |
| - | |
1304 |
| - | |
1305 |
| - | |
1306 |
| - | |
1307 |
| - | |
1308 |
| - | |
1309 |
| - | |
1310 |
| - | |
1311 | 1312 |
| |
1312 | 1313 |
| |
1313 | 1314 |
| |
|
Lines changed: 11 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
19 | 19 |
| |
20 | 20 |
| |
21 | 21 |
| |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
22 | 32 |
| |
23 | 33 |
| |
24 | 34 |
| |
| |||
52 | 62 |
| |
53 | 63 |
| |
54 | 64 |
| |
| 65 | + | |
55 | 66 |
| |
56 | 67 |
| |
57 | 68 |
| |
58 | 69 |
| |
59 | 70 |
| |
60 | 71 |
| |
61 |
| - | |
62 |
| - | |
63 |
| - | |
64 | 72 |
| |
65 | 73 |
| |
66 | 74 |
| |
|
Lines changed: 4 additions & 11 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
68 | 68 |
| |
69 | 69 |
| |
70 | 70 |
| |
71 |
| - | |
72 |
| - | |
73 |
| - | |
74 |
| - | |
75 |
| - | |
76 |
| - | |
77 |
| - | |
78 |
| - | |
79 | 71 |
| |
80 | 72 |
| |
81 | 73 |
| |
| |||
114 | 106 |
| |
115 | 107 |
| |
116 | 108 |
| |
117 |
| - | |
118 | 109 |
| |
119 | 110 |
| |
| 111 | + | |
120 | 112 |
| |
121 | 113 |
| |
122 | 114 |
| |
| |||
187 | 179 |
| |
188 | 180 |
| |
189 | 181 |
| |
190 |
| - | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
191 | 185 |
| |
192 | 186 |
| |
193 | 187 |
| |
| |||
203 | 197 |
| |
204 | 198 |
| |
205 | 199 |
| |
206 |
| - | |
207 | 200 |
| |
208 | 201 |
| |
209 | 202 |
| |
|
0 commit comments
Comments
(0)