forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit160a4f6
committed
In pg_dump, force reconnection after issuing ALTER DATABASE SET command(s).
The folly of not doing this was exposed by the buildfarm: in some cases,the GUC settings applied through ALTER DATABASE SET may be essential tointerpreting the reloaded data correctly. Another argument why we can'treally get away with the scheme proposed in commitb3f8401 is that itcannot work for parallel restore: even if the parent process manages tohang onto the previous GUC state, worker processes would see the statepost-ALTER-DATABASE. (Perhaps we could have dodged that bullet bydelaying DATABASE PROPERTIES restoration to the end of the run, butthat does nothing for the data semantics problem.)This leaves us with no solution for the default_transaction_read_only issuethat commit4bd371f intended to work around, other than "you gotta removesuch settings before dumping/upgrading". However, in view of the fact thatparallel restore broke that hack years ago and no one has noticed, it'sfair to question how many people care. I'm unexcited about adding a largedollop of new complexity to handle that corner case.This would be a one-liner fix, except it turns out that ReconnectToServertries to optimize away "redundant" reconnections. While that may have beenvaluable when coded, a quick survey of current callers shows that there areno cases where that's actually useful, so just remove that check. While atit, remove the function's useless return value.Discussion:https://postgr.es/m/12453.1516655001@sss.pgh.pa.us1 parenta541dbb commit160a4f6
File tree
4 files changed
+16
-22
lines changed- src/bin/pg_dump
4 files changed
+16
-22
lines changedLines changed: 7 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
833 | 833 |
| |
834 | 834 |
| |
835 | 835 |
| |
836 |
| - | |
837 |
| - | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
838 | 843 |
| |
839 | 844 |
| |
840 | 845 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
448 | 448 |
| |
449 | 449 |
| |
450 | 450 |
| |
451 |
| - | |
| 451 | + | |
452 | 452 |
| |
453 | 453 |
| |
454 | 454 |
| |
|
Lines changed: 2 additions & 13 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
76 | 76 |
| |
77 | 77 |
| |
78 | 78 |
| |
79 |
| - | |
80 |
| - | |
81 |
| - | |
82 |
| - | |
83 |
| - | |
| 79 | + | |
84 | 80 |
| |
85 |
| - | |
| 81 | + | |
86 | 82 |
| |
87 | 83 |
| |
88 | 84 |
| |
| |||
99 | 95 |
| |
100 | 96 |
| |
101 | 97 |
| |
102 |
| - | |
103 |
| - | |
104 |
| - | |
105 |
| - | |
106 |
| - | |
107 | 98 |
| |
108 | 99 |
| |
109 | 100 |
| |
110 | 101 |
| |
111 | 102 |
| |
112 | 103 |
| |
113 | 104 |
| |
114 |
| - | |
115 |
| - | |
116 | 105 |
| |
117 | 106 |
| |
118 | 107 |
| |
|
Lines changed: 6 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2819 | 2819 |
| |
2820 | 2820 |
| |
2821 | 2821 |
| |
2822 |
| - | |
2823 |
| - | |
2824 |
| - | |
2825 |
| - | |
| 2822 | + | |
| 2823 | + | |
| 2824 | + | |
| 2825 | + | |
| 2826 | + | |
2826 | 2827 |
| |
2827 | 2828 |
| |
2828 | 2829 |
| |
| |||
2854 | 2855 |
| |
2855 | 2856 |
| |
2856 | 2857 |
| |
2857 |
| - | |
2858 |
| - | |
| 2858 | + | |
2859 | 2859 |
| |
2860 | 2860 |
| |
2861 | 2861 |
| |
|
0 commit comments
Comments
(0)