Commit 2f81f1f
committed
Update
When `max_protocol_version` is not explicitly set, the default value is
set to "3.0". This is reasonable and is inline with the same behavior as
libpq[1]. Though, what libpq attempts to do that was not being done here
is to reasonably upgrade or auto-raise the value of
`max_protocol_version` when it has not been explicitly set.
Here, we're providing the same functionality. In libpq, this
determination is based on the parsed config values. We do the same here,
parsing the values in ParseConfig to validate and determine the
appropriate default for max_protocol_version. The string fields on
Config are then set accordingly, and re-parsed at connection time as
before.
After parsing, when `max_protocol_version` has not been explicitly set,
if `min_protocol_version` is greater than 3.0, `max_protocol_version`
defaults to `latest`; otherwise it defaults to 3.0 for compatibility
with older servers/poolers that don't support NegotiateProtocolVersion.
[1] postgres/postgres@285613cmax_protocol_version and min_protocol_version defaults1 parent 4e4eaed commit 2f81f1f
3 files changed
Lines changed: 46 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
454 | 454 | | |
455 | 455 | | |
456 | 456 | | |
457 | | - | |
| 457 | + | |
458 | 458 | | |
459 | 459 | | |
460 | 460 | | |
461 | | - | |
462 | | - | |
463 | | - | |
464 | | - | |
| 461 | + | |
465 | 462 | | |
466 | 463 | | |
467 | 464 | | |
468 | 465 | | |
| 466 | + | |
469 | 467 | | |
470 | 468 | | |
471 | 469 | | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
472 | 475 | | |
473 | | - | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
474 | 488 | | |
475 | 489 | | |
476 | 490 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1228 | 1228 | | |
1229 | 1229 | | |
1230 | 1230 | | |
| 1231 | + | |
| 1232 | + | |
| 1233 | + | |
| 1234 | + | |
| 1235 | + | |
| 1236 | + | |
1231 | 1237 | | |
1232 | 1238 | | |
1233 | 1239 | | |
1234 | 1240 | | |
1235 | 1241 | | |
1236 | 1242 | | |
1237 | 1243 | | |
1238 | | - | |
| 1244 | + | |
1239 | 1245 | | |
1240 | 1246 | | |
1241 | 1247 | | |
| |||
1244 | 1250 | | |
1245 | 1251 | | |
1246 | 1252 | | |
1247 | | - | |
| 1253 | + | |
1248 | 1254 | | |
1249 | 1255 | | |
1250 | 1256 | | |
1251 | 1257 | | |
1252 | 1258 | | |
1253 | | - | |
| 1259 | + | |
1254 | 1260 | | |
1255 | 1261 | | |
1256 | | - | |
| 1262 | + | |
1257 | 1263 | | |
1258 | 1264 | | |
1259 | 1265 | | |
1260 | 1266 | | |
1261 | 1267 | | |
1262 | | - | |
1263 | | - | |
1264 | | - | |
| 1268 | + | |
| 1269 | + | |
1265 | 1270 | | |
1266 | 1271 | | |
1267 | 1272 | | |
| 1273 | + | |
| 1274 | + | |
| 1275 | + | |
| 1276 | + | |
| 1277 | + | |
| 1278 | + | |
| 1279 | + | |
| 1280 | + | |
| 1281 | + | |
| 1282 | + | |
| 1283 | + | |
| 1284 | + | |
| 1285 | + | |
1268 | 1286 | | |
1269 | 1287 | | |
1270 | 1288 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
0 commit comments