forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitdb96e1c
committed
Rewrite PQping to be more like what we agreed to last week.
Basically, we want to distinguish all cases where the connection wasnot made from those where it was. A convenient proxy for this is tosee if we got a message with a SQLSTATE code back from the postmaster.This presumes that the postmaster will always send us a SQLSTATE ina failure message, which is true for 7.4 and later postmasters inevery case except fork failure. (We could possibly complicate thepostmaster code to do something about that, but it seems not worththe trouble, especially since pg_ctl's response for that case shouldbe to keep waiting anyway.)If we did get a SQLSTATE from the postmaster, there are basically onlytwo cases, as per last week's discussion: ERRCODE_CANNOT_CONNECT_NOWand everything else. Any other error code implies that the postmasteris in principle willing to accept connections, it just didn't like orcouldn't handle this particular request. We want to make a specialcase for ERRCODE_CANNOT_CONNECT_NOW so that "pg_ctl start -w" knowsit should keep waiting.In passing, pick names for the enum constants that are a tad lesslikely to present collision hazards in future.1 parentbe3b666 commitdb96e1c
File tree
6 files changed
+209
-134
lines changed- doc/src/sgml
- src
- bin/pg_ctl
- interfaces/libpq
6 files changed
+209
-134
lines changedLines changed: 84 additions & 68 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1060 | 1060 |
| |
1061 | 1061 |
| |
1062 | 1062 |
| |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
| 1068 | + | |
| 1069 | + | |
| 1070 | + | |
| 1071 | + | |
| 1072 | + | |
| 1073 | + | |
| 1074 | + | |
| 1075 | + | |
| 1076 | + | |
| 1077 | + | |
| 1078 | + | |
| 1079 | + | |
| 1080 | + | |
| 1081 | + | |
| 1082 | + | |
| 1083 | + | |
| 1084 | + | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
| 1091 | + | |
| 1092 | + | |
| 1093 | + | |
| 1094 | + | |
| 1095 | + | |
| 1096 | + | |
| 1097 | + | |
| 1098 | + | |
| 1099 | + | |
| 1100 | + | |
| 1101 | + | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
| 1106 | + | |
| 1107 | + | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
| 1112 | + | |
| 1113 | + | |
| 1114 | + | |
| 1115 | + | |
| 1116 | + | |
| 1117 | + | |
| 1118 | + | |
| 1119 | + | |
| 1120 | + | |
| 1121 | + | |
| 1122 | + | |
| 1123 | + | |
| 1124 | + | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
| 1129 | + | |
| 1130 | + | |
| 1131 | + | |
| 1132 | + | |
| 1133 | + | |
| 1134 | + | |
| 1135 | + | |
| 1136 | + | |
| 1137 | + | |
| 1138 | + | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
1063 | 1147 |
| |
1064 | 1148 |
| |
1065 | 1149 |
| |
| |||
1511 | 1595 |
| |
1512 | 1596 |
| |
1513 | 1597 |
| |
1514 |
| - | |
1515 |
| - | |
1516 |
| - | |
1517 |
| - | |
1518 |
| - | |
1519 |
| - | |
1520 |
| - | |
1521 |
| - | |
1522 |
| - | |
1523 |
| - | |
1524 |
| - | |
1525 |
| - | |
1526 |
| - | |
1527 |
| - | |
1528 |
| - | |
1529 |
| - | |
1530 |
| - | |
1531 |
| - | |
1532 |
| - | |
1533 |
| - | |
1534 |
| - | |
1535 |
| - | |
1536 |
| - | |
1537 |
| - | |
1538 |
| - | |
1539 |
| - | |
1540 |
| - | |
1541 |
| - | |
1542 |
| - | |
1543 |
| - | |
1544 |
| - | |
1545 |
| - | |
1546 |
| - | |
1547 |
| - | |
1548 |
| - | |
1549 |
| - | |
1550 |
| - | |
1551 |
| - | |
1552 |
| - | |
1553 |
| - | |
1554 |
| - | |
1555 |
| - | |
1556 |
| - | |
1557 |
| - | |
1558 |
| - | |
1559 |
| - | |
1560 |
| - | |
1561 |
| - | |
1562 |
| - | |
1563 |
| - | |
1564 |
| - | |
1565 |
| - | |
1566 |
| - | |
1567 |
| - | |
1568 |
| - | |
1569 |
| - | |
1570 |
| - | |
1571 |
| - | |
1572 |
| - | |
1573 |
| - | |
1574 |
| - | |
1575 |
| - | |
1576 |
| - | |
1577 |
| - | |
1578 |
| - | |
1579 |
| - | |
1580 |
| - | |
1581 |
| - | |
1582 | 1598 |
| |
1583 | 1599 |
| |
1584 | 1600 |
| |
|
Lines changed: 48 additions & 43 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
397 | 397 |
| |
398 | 398 |
| |
399 | 399 |
| |
| 400 | + | |
400 | 401 |
| |
401 | 402 |
| |
402 | 403 |
| |
403 | 404 |
| |
404 | 405 |
| |
405 | 406 |
| |
406 |
| - | |
| 407 | + | |
407 | 408 |
| |
408 | 409 |
| |
409 | 410 |
| |
410 | 411 |
| |
411 | 412 |
| |
412 | 413 |
| |
413 |
| - | |
| 414 | + | |
414 | 415 |
| |
415 | 416 |
| |
416 | 417 |
| |
| |||
453 | 454 |
| |
454 | 455 |
| |
455 | 456 |
| |
456 |
| - | |
| 457 | + | |
457 | 458 |
| |
458 | 459 |
| |
459 | 460 |
| |
| |||
491 | 492 |
| |
492 | 493 |
| |
493 | 494 |
| |
494 |
| - | |
| 495 | + | |
495 | 496 |
| |
496 | 497 |
| |
497 | 498 |
| |
498 |
| - | |
| 499 | + | |
499 | 500 |
| |
500 | 501 |
| |
501 | 502 |
| |
| |||
507 | 508 |
| |
508 | 509 |
| |
509 | 510 |
| |
510 |
| - | |
511 |
| - | |
512 |
| - | |
513 |
| - | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
514 | 515 |
| |
515 |
| - | |
516 |
| - | |
517 |
| - | |
518 |
| - | |
519 |
| - | |
520 |
| - | |
521 |
| - | |
522 |
| - | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
523 | 524 |
| |
524 |
| - | |
525 |
| - | |
526 |
| - | |
527 |
| - | |
528 |
| - | |
529 |
| - | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
530 | 530 |
| |
531 |
| - | |
| 531 | + | |
532 | 532 |
| |
533 |
| - | |
534 |
| - | |
| 533 | + | |
535 | 534 |
| |
536 | 535 |
| |
537 |
| - | |
| 536 | + | |
538 | 537 |
| |
539 | 538 |
| |
540 | 539 |
| |
| |||
738 | 737 |
| |
739 | 738 |
| |
740 | 739 |
| |
741 |
| - | |
742 |
| - | |
743 | 740 |
| |
744 | 741 |
| |
745 |
| - | |
746 |
| - | |
747 |
| - | |
748 |
| - | |
749 |
| - | |
750 |
| - | |
751 |
| - | |
752 |
| - | |
| 742 | + | |
753 | 743 |
| |
754 |
| - | |
755 |
| - | |
756 |
| - | |
757 |
| - | |
758 |
| - | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
759 | 764 |
| |
760 | 765 |
| |
761 | 766 |
| |
| |||
1289 | 1294 |
| |
1290 | 1295 |
| |
1291 | 1296 |
| |
1292 |
| - | |
| 1297 | + | |
1293 | 1298 |
| |
1294 | 1299 |
| |
1295 | 1300 |
| |
|
0 commit comments
Comments
(0)