forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit2281575
committed
Avoid dump/reload problems when using both plpython2 and plpython3.
Commit8037160 installed a safeguard against loading plpython2and plpython3 at the same time, but asserted that both could still beused in the same database, just not in the same session. However, that'snot actually all that practical because dumping and reloading will fail(since both libraries necessarily get loaded into the restoring session).pg_upgrade is even worse, because it checks for missing libraries byloading every .so library mentioned in the entire installation into onesession, so that you can have only one across the whole cluster.We can improve matters by not throwing the error immediately in _PG_init,but only when and if we're asked to do something that requires callinginto libpython. This ameliorates both of the above situations, sincewhile execution of CREATE LANGUAGE, CREATE FUNCTION, etc will result inloading plpython, it isn't asked to do anything interesting (at leastnot if check_function_bodies is off, as it will be during a restore).It's possible that this opens some corner-case holes in which a crashcould be provoked with sufficient effort. However, since plpythononly exists as an untrusted language, any such crash would requiresuperuser privileges, making it "don't do that" not a security issue.To reduce the hazards in this area, the error is still FATAL when itdoes get thrown.Per a report from Paul Jones. Back-patch to 9.2, which is as far backas the patch applies without work. (It could be made to work in 9.1,but given the lack of previous complaints, I'm disinclined to expendeffort so far back. We've been pretty desultory about support forPython 3 in 9.1 anyway.)1 parent78b7aaa commit2281575
1 file changed
+71
-10
lines changedLines changed: 71 additions & 10 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
63 | 63 |
| |
64 | 64 |
| |
65 | 65 |
| |
| 66 | + | |
| 67 | + | |
| 68 | + | |
66 | 69 |
| |
67 | 70 |
| |
68 | 71 |
| |
| |||
75 | 78 |
| |
76 | 79 |
| |
77 | 80 |
| |
78 |
| - | |
79 |
| - | |
| 81 | + | |
80 | 82 |
| |
81 | 83 |
| |
82 |
| - | |
83 |
| - | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
84 | 99 |
| |
85 |
| - | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
86 | 117 |
| |
87 | 118 |
| |
88 | 119 |
| |
89 | 120 |
| |
90 | 121 |
| |
91 |
| - | |
| 122 | + | |
92 | 123 |
| |
93 | 124 |
| |
94 | 125 |
| |
95 | 126 |
| |
96 | 127 |
| |
97 | 128 |
| |
| 129 | + | |
98 | 130 |
| |
99 |
| - | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
100 | 156 |
| |
101 | 157 |
| |
102 | 158 |
| |
| |||
120 | 176 |
| |
121 | 177 |
| |
122 | 178 |
| |
123 |
| - | |
| 179 | + | |
124 | 180 |
| |
125 | 181 |
| |
126 | 182 |
| |
| |||
155 | 211 |
| |
156 | 212 |
| |
157 | 213 |
| |
158 |
| - | |
159 | 214 |
| |
160 |
| - | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
161 | 218 |
| |
162 | 219 |
| |
163 | 220 |
| |
| |||
191 | 248 |
| |
192 | 249 |
| |
193 | 250 |
| |
| 251 | + | |
| 252 | + | |
194 | 253 |
| |
195 | 254 |
| |
196 | 255 |
| |
| |||
266 | 325 |
| |
267 | 326 |
| |
268 | 327 |
| |
| 328 | + | |
| 329 | + | |
269 | 330 |
| |
270 | 331 |
| |
271 | 332 |
| |
|
0 commit comments
Comments
(0)