- Notifications
You must be signed in to change notification settings - Fork4.9k
Commit285613c
committed
libpq: Add min/max_protocol_version connection options
All supported version of the PostgreSQL server send theNegotiateProtocolVersion message when an unsupported minor protocolversion is requested by a client. But many other applications thatimplement the PostgreSQL protocol (connection poolers, or otherdatabases) do not, and the same is true for PostgreSQL server versionsolder than 9.3. Connecting to such other applications thus fails if aclient requests a protocol version different than 3.0.This patch adds a max_protocol_version connection option to libpq thatspecifies the protocol version that libpq should request from theserver. Currently only 3.0 is supported, but that will change in afuture commit that bumps the protocol version. Even after that versionbump the default will likely stay 3.0 for the time being. Once more ofthe ecosystem supports the NegotiateProtocolVersion message we mightwant to change the default to the latest minor version.This also adds the similar min_protocol_version connection option, toallow the client to specify that connecting should fail if a lowerprotocol version is attempted by the server. This can be used toensure that certain protocol features are used, which can beparticularly useful if those features impact security.Author: Jelte Fennema-Nio <postgres@jeltef.nl>Reviewed-by: Robert Haas <robertmhaas@gmail.com> (earlier versions)Discussion:https://www.postgresql.org/message-id/CAGECzQTfc_O%2BHXqAo5_-xG4r3EFVsTefUeQzSvhEyyLDba-O9w@mail.gmail.comDiscussion:https://www.postgresql.org/message-id/CAGECzQRbAGqJnnJJxTdKewTsNOovUt4bsx3NFfofz3m2j-t7tA@mail.gmail.com1 parent5070349 commit285613c
File tree
7 files changed
+315
-12
lines changed- doc/src/sgml
- src
- include/libpq
- interfaces/libpq
- test/modules/libpq_pipeline
7 files changed
+315
-12
lines changedLines changed: 68 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2144 | 2144 |
| |
2145 | 2145 |
| |
2146 | 2146 |
| |
| 2147 | + | |
| 2148 | + | |
| 2149 | + | |
| 2150 | + | |
| 2151 | + | |
| 2152 | + | |
| 2153 | + | |
| 2154 | + | |
| 2155 | + | |
| 2156 | + | |
| 2157 | + | |
| 2158 | + | |
| 2159 | + | |
| 2160 | + | |
| 2161 | + | |
| 2162 | + | |
| 2163 | + | |
| 2164 | + | |
| 2165 | + | |
| 2166 | + | |
| 2167 | + | |
| 2168 | + | |
| 2169 | + | |
| 2170 | + | |
| 2171 | + | |
| 2172 | + | |
| 2173 | + | |
| 2174 | + | |
| 2175 | + | |
| 2176 | + | |
| 2177 | + | |
| 2178 | + | |
| 2179 | + | |
| 2180 | + | |
| 2181 | + | |
| 2182 | + | |
| 2183 | + | |
| 2184 | + | |
| 2185 | + | |
| 2186 | + | |
| 2187 | + | |
| 2188 | + | |
| 2189 | + | |
| 2190 | + | |
| 2191 | + | |
| 2192 | + | |
| 2193 | + | |
| 2194 | + | |
2147 | 2195 |
| |
2148 | 2196 |
| |
2149 | 2197 |
| |
| |||
9329 | 9377 |
| |
9330 | 9378 |
| |
9331 | 9379 |
| |
| 9380 | + | |
| 9381 | + | |
| 9382 | + | |
| 9383 | + | |
| 9384 | + | |
| 9385 | + | |
| 9386 | + | |
| 9387 | + | |
| 9388 | + | |
| 9389 | + | |
| 9390 | + | |
| 9391 | + | |
| 9392 | + | |
| 9393 | + | |
| 9394 | + | |
| 9395 | + | |
| 9396 | + | |
| 9397 | + | |
| 9398 | + | |
| 9399 | + | |
9332 | 9400 |
| |
9333 | 9401 |
| |
9334 | 9402 |
| |
|
Lines changed: 26 additions & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
18 | 18 |
| |
19 | 19 |
| |
20 | 20 |
| |
21 |
| - | |
22 |
| - | |
23 |
| - | |
24 |
| - | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
25 | 31 |
| |
26 | 32 |
| |
27 | 33 |
| |
28 | 34 |
| |
29 | 35 |
| |
30 | 36 |
| |
31 |
| - | |
| 37 | + | |
32 | 38 |
| |
33 | 39 |
| |
34 | 40 |
| |
35 | 41 |
| |
36 | 42 |
| |
37 | 43 |
| |
38 | 44 |
| |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
39 | 52 |
| |
40 | 53 |
| |
41 | 54 |
| |
| |||
413 | 426 |
| |
414 | 427 |
| |
415 | 428 |
| |
416 |
| - | |
417 |
| - | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
418 | 437 |
| |
419 | 438 |
| |
420 | 439 |
| |
|
Lines changed: 1 addition & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
91 | 91 |
| |
92 | 92 |
| |
93 | 93 |
| |
94 |
| - | |
95 | 94 |
| |
96 | 95 |
| |
97 | 96 |
| |
98 |
| - | |
| 97 | + | |
99 | 98 |
| |
100 | 99 |
| |
101 | 100 |
| |
|
Lines changed: 87 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
325 | 325 |
| |
326 | 326 |
| |
327 | 327 |
| |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
328 | 338 |
| |
329 | 339 |
| |
330 | 340 |
| |
| |||
483 | 493 |
| |
484 | 494 |
| |
485 | 495 |
| |
| 496 | + | |
486 | 497 |
| |
487 | 498 |
| |
488 | 499 |
| |
| |||
2081 | 2092 |
| |
2082 | 2093 |
| |
2083 | 2094 |
| |
| 2095 | + | |
| 2096 | + | |
| 2097 | + | |
| 2098 | + | |
| 2099 | + | |
| 2100 | + | |
| 2101 | + | |
| 2102 | + | |
| 2103 | + | |
| 2104 | + | |
| 2105 | + | |
| 2106 | + | |
| 2107 | + | |
| 2108 | + | |
| 2109 | + | |
| 2110 | + | |
| 2111 | + | |
| 2112 | + | |
| 2113 | + | |
| 2114 | + | |
| 2115 | + | |
| 2116 | + | |
| 2117 | + | |
| 2118 | + | |
| 2119 | + | |
| 2120 | + | |
| 2121 | + | |
| 2122 | + | |
| 2123 | + | |
| 2124 | + | |
| 2125 | + | |
| 2126 | + | |
| 2127 | + | |
| 2128 | + | |
| 2129 | + | |
| 2130 | + | |
| 2131 | + | |
| 2132 | + | |
| 2133 | + | |
| 2134 | + | |
| 2135 | + | |
| 2136 | + | |
2084 | 2137 |
| |
2085 | 2138 |
| |
2086 | 2139 |
| |
| |||
3084 | 3137 |
| |
3085 | 3138 |
| |
3086 | 3139 |
| |
3087 |
| - | |
| 3140 | + | |
3088 | 3141 |
| |
3089 | 3142 |
| |
3090 | 3143 |
| |
| |||
4102 | 4155 |
| |
4103 | 4156 |
| |
4104 | 4157 |
| |
| 4158 | + | |
4105 | 4159 |
| |
4106 | 4160 |
| |
4107 | 4161 |
| |
| |||
8157 | 8211 |
| |
8158 | 8212 |
| |
8159 | 8213 |
| |
| 8214 | + | |
| 8215 | + | |
| 8216 | + | |
| 8217 | + | |
| 8218 | + | |
| 8219 | + | |
| 8220 | + | |
| 8221 | + | |
| 8222 | + | |
| 8223 | + | |
| 8224 | + | |
| 8225 | + | |
| 8226 | + | |
| 8227 | + | |
| 8228 | + | |
| 8229 | + | |
| 8230 | + | |
| 8231 | + | |
| 8232 | + | |
| 8233 | + | |
| 8234 | + | |
| 8235 | + | |
| 8236 | + | |
| 8237 | + | |
| 8238 | + | |
| 8239 | + | |
| 8240 | + | |
| 8241 | + | |
| 8242 | + | |
| 8243 | + | |
| 8244 | + | |
| 8245 | + | |
8160 | 8246 |
| |
8161 | 8247 |
| |
8162 | 8248 |
| |
|
Lines changed: 18 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1432 | 1432 |
| |
1433 | 1433 |
| |
1434 | 1434 |
| |
| 1435 | + | |
| 1436 | + | |
| 1437 | + | |
| 1438 | + | |
| 1439 | + | |
| 1440 | + | |
| 1441 | + | |
1435 | 1442 |
| |
1436 | 1443 |
| |
1437 | 1444 |
| |
| |||
1444 | 1451 |
| |
1445 | 1452 |
| |
1446 | 1453 |
| |
| 1454 | + | |
| 1455 | + | |
| 1456 | + | |
| 1457 | + | |
| 1458 | + | |
| 1459 | + | |
| 1460 | + | |
| 1461 | + | |
| 1462 | + | |
| 1463 | + | |
| 1464 | + | |
1447 | 1465 |
| |
1448 | 1466 |
| |
1449 | 1467 |
| |
|
Lines changed: 4 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
417 | 417 |
| |
418 | 418 |
| |
419 | 419 |
| |
| 420 | + | |
| 421 | + | |
420 | 422 |
| |
421 | 423 |
| |
422 | 424 |
| |
| |||
539 | 541 |
| |
540 | 542 |
| |
541 | 543 |
| |
| 544 | + | |
| 545 | + | |
542 | 546 |
| |
543 | 547 |
| |
544 | 548 |
| |
|
0 commit comments
Comments
(0)