forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit4247db6
committed
Client-side fixes for delayed NOTIFY receipt.
PQnotifies() is defined to just process already-read data, not try to readany more from the socket. (This is a debatable decision, perhaps, but I'mhesitant to change longstanding library behavior.) The documentation haslong recommended calling PQconsumeInput() before PQnotifies() to ensurethat any already-arrived message would get absorbed and processed.However, psql did not get that memo, which explains why it's not veryreliable about reporting notifications promptly.Also, most (not quite all) callers called PQconsumeInput() just once beforea PQnotifies() loop. Taking this recommendation seriously implies that weshould do PQconsumeInput() before each call. This is more important nowthat we have "payload" strings in notification messages than it was before;that increases the probability of having more than one packet's worthof notify messages. Hence, adjust code as well as documentation examplesto do it like that.Back-patch to 9.5 to match related server fixes. In principle we couldprobably go back further with these changes, but given lack of fieldcomplaints I doubt it's worthwhile.Discussion:https://postgr.es/m/CAOYf6ec-TmRYjKBXLLaGaB-jrd=mjG1Hzn1a1wufUAR39PQYhw@mail.gmail.com1 parent2ddb914 commit4247db6
File tree
5 files changed
+12
-4
lines changed- doc/src/sgml
- src
- bin/psql
- interfaces
- ecpg/ecpglib
- libpq
- test/examples
5 files changed
+12
-4
lines changedLines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
5284 | 5284 |
| |
5285 | 5285 |
| |
5286 | 5286 |
| |
5287 |
| - | |
| 5287 | + | |
5288 | 5288 |
| |
5289 | 5289 |
| |
5290 | 5290 |
| |
| |||
8711 | 8711 |
| |
8712 | 8712 |
| |
8713 | 8713 |
| |
| 8714 | + | |
8714 | 8715 |
| |
8715 | 8716 |
| |
8716 | 8717 |
| |
|
Lines changed: 3 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
836 | 836 |
| |
837 | 837 |
| |
838 | 838 |
| |
839 |
| - | |
| 839 | + | |
| 840 | + | |
840 | 841 |
| |
841 | 842 |
| |
842 | 843 |
| |
| |||
847 | 848 |
| |
848 | 849 |
| |
849 | 850 |
| |
| 851 | + | |
850 | 852 |
| |
851 | 853 |
| |
852 | 854 |
| |
|
Lines changed: 3 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1722 | 1722 |
| |
1723 | 1723 |
| |
1724 | 1724 |
| |
1725 |
| - | |
1726 |
| - | |
| 1725 | + | |
| 1726 | + | |
1727 | 1727 |
| |
1728 | 1728 |
| |
1729 | 1729 |
| |
1730 | 1730 |
| |
| 1731 | + | |
1731 | 1732 |
| |
1732 | 1733 |
| |
1733 | 1734 |
| |
|
Lines changed: 3 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2265 | 2265 |
| |
2266 | 2266 |
| |
2267 | 2267 |
| |
| 2268 | + | |
| 2269 | + | |
| 2270 | + | |
2268 | 2271 |
| |
2269 | 2272 |
| |
2270 | 2273 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
140 | 140 |
| |
141 | 141 |
| |
142 | 142 |
| |
| 143 | + | |
143 | 144 |
| |
144 | 145 |
| |
145 | 146 |
| |
|
0 commit comments
Comments
(0)