forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit5e73a60
committed
Switch pg_dump to use compression specifications
Compression specifications are currently used by pg_basebackup andpg_receivewal, and are able to let the user control in an extended waythe method and level of compression used. As an effect of this commit,pg_dump's -Z/--compress is now able to use more than just an integer, asof the grammar "method[:detail]".The method can be either "none" or "gzip", and can optionally take adetail string. If the detail string is only an integer, it defines thecompression level. A comma-separated list of keywords can also be usedmethod allows for more options, the only keyword supported now is"level".The change is backward-compatible, hence specifying only an integerleads to no compression for a level of 0 and gzip compression when thelevel is greater than 0.Most of the code changes are straight-forward, as pg_dump was relying onan integer tracking the compression level to check for gzip or nocompression. These are changed to use a compression specification andthe algorithm stored in it.As of this change, note that the dump format is not bumped because thereis no need yet to track the compression algorithm in the TOC entries.Hence, we still rely on the compression level to make the differencewhen reading them. This will be mandatory once a new compression methodis added, though.In order to keep the code simpler when parsing the compressionspecification, the code is changed so as pg_dump now fails hard whenusing gzip on -Z/--compress without its support compiled, rather thanenforcing no compression without the user knowing about it exceptthrough a warning. Like before this commit, archive and custom formatsare compressed by default when the code is compiled with gzip, and leftuncompressed without gzip.Author: Georgios KokolatosReviewed-by: Michael PaquierDiscussion:https://postgr.es/m/O4mutIrCES8ZhlXJiMvzsivT7ztAMja2lkdL1LJx6O5f22I2W8PBIeLKz7mDLwxHoibcnRAYJXm1pH4tyUNC4a8eDzLn22a6Pb1S74Niexg=@pm.me1 parentedf12e7 commit5e73a60
File tree
14 files changed
+260
-160
lines changed- doc/src/sgml/ref
- src
- bin/pg_dump
- t
- test/modules/test_pg_dump/t
- tools/pgindent
14 files changed
+260
-160
lines changedLines changed: 30 additions & 8 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
644 | 644 |
| |
645 | 645 |
| |
646 | 646 |
| |
647 |
| - | |
648 |
| - | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
649 | 651 |
| |
650 | 652 |
| |
651 |
| - | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
652 | 672 |
| |
653 |
| - | |
654 |
| - | |
655 |
| - | |
656 |
| - | |
657 |
| - | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
658 | 680 |
| |
659 | 681 |
| |
660 | 682 |
| |
|
Lines changed: 44 additions & 63 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
64 | 64 |
| |
65 | 65 |
| |
66 | 66 |
| |
67 |
| - | |
| 67 | + | |
68 | 68 |
| |
69 | 69 |
| |
70 | 70 |
| |
| |||
74 | 74 |
| |
75 | 75 |
| |
76 | 76 |
| |
77 |
| - | |
78 |
| - | |
79 |
| - | |
80 | 77 |
| |
81 | 78 |
| |
82 | 79 |
| |
| |||
93 | 90 |
| |
94 | 91 |
| |
95 | 92 |
| |
96 |
| - | |
97 |
| - | |
98 |
| - | |
99 |
| - | |
100 |
| - | |
101 |
| - | |
102 |
| - | |
103 |
| - | |
104 |
| - | |
105 |
| - | |
106 |
| - | |
107 |
| - | |
108 |
| - | |
109 |
| - | |
110 |
| - | |
111 |
| - | |
112 |
| - | |
113 |
| - | |
114 |
| - | |
115 |
| - | |
116 |
| - | |
117 |
| - | |
118 |
| - | |
119 |
| - | |
120 | 93 |
| |
121 | 94 |
| |
122 | 95 |
| |
123 | 96 |
| |
124 |
| - | |
| 97 | + | |
| 98 | + | |
125 | 99 |
| |
126 | 100 |
| |
127 |
| - | |
128 |
| - | |
129 |
| - | |
130 |
| - | |
131 | 101 |
| |
132 | 102 |
| |
133 |
| - | |
| 103 | + | |
134 | 104 |
| |
135 | 105 |
| |
136 | 106 |
| |
137 | 107 |
| |
138 | 108 |
| |
139 |
| - | |
| 109 | + | |
140 | 110 |
| |
141 | 111 |
| |
142 | 112 |
| |
143 | 113 |
| |
144 | 114 |
| |
145 |
| - | |
146 |
| - | |
| 115 | + | |
| 116 | + | |
147 | 117 |
| |
148 | 118 |
| |
149 | 119 |
| |
| |||
154 | 124 |
| |
155 | 125 |
| |
156 | 126 |
| |
157 |
| - | |
| 127 | + | |
| 128 | + | |
158 | 129 |
| |
159 |
| - | |
160 |
| - | |
161 |
| - | |
162 |
| - | |
163 |
| - | |
| 130 | + | |
164 | 131 |
| |
165 |
| - | |
| 132 | + | |
166 | 133 |
| |
167 | 134 |
| |
168 | 135 |
| |
| |||
179 | 146 |
| |
180 | 147 |
| |
181 | 148 |
| |
182 |
| - | |
| 149 | + | |
183 | 150 |
| |
184 |
| - | |
| 151 | + | |
185 | 152 |
| |
186 | 153 |
| |
187 | 154 |
| |
188 | 155 |
| |
189 | 156 |
| |
190 | 157 |
| |
191 |
| - | |
| 158 | + | |
192 | 159 |
| |
193 | 160 |
| |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
194 | 166 |
| |
195 | 167 |
| |
196 | 168 |
| |
| |||
201 | 173 |
| |
202 | 174 |
| |
203 | 175 |
| |
204 |
| - | |
| 176 | + | |
205 | 177 |
| |
206 | 178 |
| |
207 | 179 |
| |
| |||
453 | 425 |
| |
454 | 426 |
| |
455 | 427 |
| |
| 428 | + | |
| 429 | + | |
456 | 430 |
| |
457 | 431 |
| |
458 |
| - | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
459 | 436 |
| |
460 | 437 |
| |
461 | 438 |
| |
462 |
| - | |
| 439 | + | |
| 440 | + | |
463 | 441 |
| |
464 | 442 |
| |
465 | 443 |
| |
466 | 444 |
| |
467 | 445 |
| |
468 | 446 |
| |
469 |
| - | |
| 447 | + | |
| 448 | + | |
470 | 449 |
| |
471 | 450 |
| |
472 | 451 |
| |
| |||
479 | 458 |
| |
480 | 459 |
| |
481 | 460 |
| |
482 |
| - | |
483 |
| - | |
484 |
| - | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
485 | 464 |
| |
486 | 465 |
| |
487 | 466 |
| |
488 | 467 |
| |
489 |
| - | |
| 468 | + | |
| 469 | + | |
490 | 470 |
| |
491 | 471 |
| |
492 | 472 |
| |
493 |
| - | |
494 |
| - | |
| 473 | + | |
| 474 | + | |
495 | 475 |
| |
496 | 476 |
| |
497 | 477 |
| |
498 | 478 |
| |
499 | 479 |
| |
500 | 480 |
| |
501 |
| - | |
| 481 | + | |
502 | 482 |
| |
503 | 483 |
| |
504 | 484 |
| |
| |||
509 | 489 |
| |
510 | 490 |
| |
511 | 491 |
| |
512 |
| - | |
| 492 | + | |
513 | 493 |
| |
514 | 494 |
| |
515 | 495 |
| |
516 | 496 |
| |
517 | 497 |
| |
518 |
| - | |
| 498 | + | |
| 499 | + | |
519 | 500 |
| |
520 | 501 |
| |
521 | 502 |
| |
522 |
| - | |
| 503 | + | |
523 | 504 |
| |
524 | 505 |
| |
525 |
| - | |
| 506 | + | |
526 | 507 |
| |
527 | 508 |
| |
528 | 509 |
| |
529 | 510 |
| |
530 | 511 |
| |
531 |
| - | |
| 512 | + | |
532 | 513 |
| |
533 | 514 |
| |
534 | 515 |
| |
|
Lines changed: 10 additions & 10 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
21 | 21 |
| |
22 | 22 |
| |
23 | 23 |
| |
24 |
| - | |
25 |
| - | |
26 |
| - | |
27 |
| - | |
28 |
| - | |
29 |
| - | |
30 | 24 |
| |
31 | 25 |
| |
32 | 26 |
| |
| |||
46 | 40 |
| |
47 | 41 |
| |
48 | 42 |
| |
49 |
| - | |
50 |
| - | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
51 | 47 |
| |
52 | 48 |
| |
53 | 49 |
| |
| |||
56 | 52 |
| |
57 | 53 |
| |
58 | 54 |
| |
59 |
| - | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
60 | 59 |
| |
61 |
| - | |
| 60 | + | |
| 61 | + | |
62 | 62 |
| |
63 | 63 |
| |
64 | 64 |
| |
|
Lines changed: 5 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
23 | 23 |
| |
24 | 24 |
| |
25 | 25 |
| |
| 26 | + | |
26 | 27 |
| |
27 | 28 |
| |
28 | 29 |
| |
| |||
143 | 144 |
| |
144 | 145 |
| |
145 | 146 |
| |
146 |
| - | |
| 147 | + | |
| 148 | + | |
147 | 149 |
| |
148 | 150 |
| |
149 | 151 |
| |
| |||
303 | 305 |
| |
304 | 306 |
| |
305 | 307 |
| |
306 |
| - | |
| 308 | + | |
| 309 | + | |
307 | 310 |
| |
308 | 311 |
| |
309 | 312 |
| |
|
0 commit comments
Comments
(0)