forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit9e5f1f2
committed
Rethink recent fix for pg_dump's handling of extension config tables.
Commit3eb3d3e was a few bricks shy of a load: while it correctlyset the table's "interesting" flag when deciding to dump the data ofan extension config table, it was not correct to clear that flagif we concluded we shouldn't dump the data. This led to the crashreported in bug #16655, because in fact we'll traverse dumpTableSchemaanyway for all extension tables (to see if they have user-addedseclabels or RLS policies).The right thing to do is to force "interesting" true in makeTableDataInfo,and otherwise leave the flag alone. (Doing it there is more future-proofin case additional calls are added, and it also avoids setting the flagunnecessarily if that function decides the table is non-dumpable.)This investigation also showed that while only the --inserts code pathhad an obvious failure in the case considered by3eb3d3e, the COPYcode path also has a problem with not having loaded table subsidiarydata. That causes fmtCopyColumnList to silently return an empty stringinstead of the correct column list. That accidentally mostly works,which perhaps is why we didn't notice this before. It would only failif the restore column order is different from the dump column order,which only happens in weird inheritance cases, so it's not surprisingnobody had hit the case with an extension config table. Nonetheless,it's a bug, and it goes a long way back, not just to v12 where the--inserts code path started to have a problem with this.In hopes of catching such cases a bit sooner in future, add someAsserts that "interesting" has been set in both dumpTableData anddumpTableSchema. Adjust the test case added by3eb3d3e so that itchecks the COPY rather than INSERT form of that bug, allowing it todetect the longer-standing symptom.Per bug #16655 from Cameron Daniel. Back-patch to all supportedbranches.Discussion:https://postgr.es/m/16655-5c92d6b3a9438137@postgresql.orgDiscussion:https://postgr.es/m/18048b44-3414-b983-8c7c-9165b177900d@2ndQuadrant.com1 parentf077070 commit9e5f1f2
File tree
3 files changed
+43
-23
lines changed- src
- bin/pg_dump
- test/modules/test_pg_dump
- t
3 files changed
+43
-23
lines changedLines changed: 10 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2098 | 2098 |
| |
2099 | 2099 |
| |
2100 | 2100 |
| |
2101 |
| - | |
2102 |
| - | |
2103 | 2101 |
| |
2104 | 2102 |
| |
2105 | 2103 |
| |
| |||
2260 | 2258 |
| |
2261 | 2259 |
| |
2262 | 2260 |
| |
| 2261 | + | |
| 2262 | + | |
| 2263 | + | |
2263 | 2264 |
| |
2264 | 2265 |
| |
2265 | 2266 |
| |
| |||
2451 | 2452 |
| |
2452 | 2453 |
| |
2453 | 2454 |
| |
| 2455 | + | |
| 2456 | + | |
| 2457 | + | |
2454 | 2458 |
| |
2455 | 2459 |
| |
2456 | 2460 |
| |
| |||
8728 | 8732 |
| |
8729 | 8733 |
| |
8730 | 8734 |
| |
8731 |
| - | |
| 8735 | + | |
8732 | 8736 |
| |
8733 | 8737 |
| |
8734 | 8738 |
| |
| |||
15538 | 15542 |
| |
15539 | 15543 |
| |
15540 | 15544 |
| |
| 15545 | + | |
| 15546 | + | |
| 15547 | + | |
15541 | 15548 |
| |
15542 | 15549 |
| |
15543 | 15550 |
| |
15544 |
| - | |
15545 | 15551 |
| |
15546 | 15552 |
| |
15547 | 15553 |
| |
| |||
17912 | 17918 |
| |
17913 | 17919 |
| |
17914 | 17920 |
| |
17915 |
| - | |
17916 |
| - | |
17917 | 17921 |
| |
17918 | 17922 |
| |
17919 | 17923 |
| |
|
Lines changed: 30 additions & 14 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
135 | 135 |
| |
136 | 136 |
| |
137 | 137 |
| |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
138 | 146 |
| |
139 | 147 |
| |
140 |
| - | |
| 148 | + | |
141 | 149 |
| |
142 | 150 |
| |
143 | 151 |
| |
| |||
225 | 233 |
| |
226 | 234 |
| |
227 | 235 |
| |
| 236 | + | |
228 | 237 |
| |
229 | 238 |
| |
230 | 239 |
| |
| |||
317 | 326 |
| |
318 | 327 |
| |
319 | 328 |
| |
320 |
| - | |
| 329 | + | |
| 330 | + | |
321 | 331 |
| |
322 | 332 |
| |
323 | 333 |
| |
324 | 334 |
| |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
325 | 351 |
| |
326 | 352 |
| |
327 | 353 |
| |
| |||
443 | 469 |
| |
444 | 470 |
| |
445 | 471 |
| |
446 |
| - | |
| 472 | + | |
| 473 | + | |
447 | 474 |
| |
448 | 475 |
| |
449 | 476 |
| |
| |||
578 | 605 |
| |
579 | 606 |
| |
580 | 607 |
| |
581 |
| - | |
582 |
| - | |
583 |
| - | |
584 |
| - | |
585 |
| - | |
586 |
| - | |
587 |
| - | |
588 |
| - | |
589 |
| - | |
590 |
| - | |
591 |
| - | |
592 | 608 |
| |
593 | 609 |
| |
594 | 610 |
| |
|
Lines changed: 3 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
5 | 5 |
| |
6 | 6 |
| |
7 | 7 |
| |
8 |
| - | |
| 8 | + | |
9 | 9 |
| |
10 | 10 |
| |
11 | 11 |
| |
| |||
14 | 14 |
| |
15 | 15 |
| |
16 | 16 |
| |
17 |
| - | |
| 17 | + | |
18 | 18 |
| |
19 | 19 |
| |
20 | 20 |
| |
| |||
34 | 34 |
| |
35 | 35 |
| |
36 | 36 |
| |
37 |
| - | |
| 37 | + | |
38 | 38 |
| |
39 | 39 |
| |
40 | 40 |
| |
|
0 commit comments
Comments
(0)