postgresql/src/bin/psql
Tom Lane 4247db6252 Client-side fixes for delayed NOTIFY receipt.
PQnotifies() is defined to just process already-read data, not try to read
any more from the socket.  (This is a debatable decision, perhaps, but I'm
hesitant to change longstanding library behavior.)  The documentation has
long recommended calling PQconsumeInput() before PQnotifies() to ensure
that any already-arrived message would get absorbed and processed.
However, psql did not get that memo, which explains why it's not very
reliable about reporting notifications promptly.

Also, most (not quite all) callers called PQconsumeInput() just once before
a PQnotifies() loop.  Taking this recommendation seriously implies that we
should do PQconsumeInput() before each call.  This is more important now
that we have "payload" strings in notification messages than it was before;
that increases the probability of having more than one packet's worth
of notify messages.  Hence, adjust code as well as documentation examples
to do it like that.

Back-patch to 9.5 to match related server fixes.  In principle we could
probably go back further with these changes, but given lack of field
complaints I doubt it's worthwhile.

Discussion: https://postgr.es/m/CAOYf6ec-TmRYjKBXLLaGaB-jrd=mjG1Hzn1a1wufUAR39PQYhw@mail.gmail.com
2018-10-19 22:22:57 -04:00
..
po Translation updates 2018-06-25 12:37:18 +02:00
.gitignore Move psql's psqlscan.l into src/fe_utils. 2016-03-24 20:28:47 -04:00
command.c Remove no-longer-appropriate special case in psql's \conninfo code. 2018-08-03 12:20:47 -04:00
command.h Add \if support to pgbench 2018-03-22 17:42:03 +03:00
common.c Client-side fixes for delayed NOTIFY receipt. 2018-10-19 22:22:57 -04:00
common.h Update copyright for 2018 2018-01-02 23:30:12 -05:00
copy.c Update copyright for 2018 2018-01-02 23:30:12 -05:00
copy.h Update copyright for 2018 2018-01-02 23:30:12 -05:00
create_help.pl Restrict vertical tightness to parentheses in Perl code 2018-05-09 10:14:46 -04:00
crosstabview.c Update copyright for 2018 2018-01-02 23:30:12 -05:00
crosstabview.h Fix a boatload of typos in C comments. 2018-04-01 15:01:28 -04:00
describe.c Fix psql's \dC command to annotate I/O conversion casts as such. 2018-08-31 16:45:33 -04:00
describe.h Update copyright for 2018 2018-01-02 23:30:12 -05:00
help.c Message style improvements 2018-09-13 23:35:43 +02:00
help.h Update copyright for 2018 2018-01-02 23:30:12 -05:00
input.c Update copyright for 2018 2018-01-02 23:30:12 -05:00
input.h Update copyright for 2018 2018-01-02 23:30:12 -05:00
large_obj.c Update copyright for 2018 2018-01-02 23:30:12 -05:00
large_obj.h Update copyright for 2018 2018-01-02 23:30:12 -05:00
mainloop.c Post-feature-freeze pgindent run. 2018-04-26 14:47:16 -04:00
mainloop.h Update copyright for 2018 2018-01-02 23:30:12 -05:00
Makefile Prevent accidental linking of system-supplied copies of libpq.so etc. 2018-04-03 16:26:05 -04:00
nls.mk Translation updates 2017-08-07 13:55:34 -04:00
prompt.c Update copyright for 2018 2018-01-02 23:30:12 -05:00
prompt.h Add \if support to pgbench 2018-03-22 17:42:03 +03:00
psqlrc.sample Improve FILES section of psql reference page. 2014-01-14 19:27:57 -05:00
psqlscanslash.h Update copyright for 2018 2018-01-02 23:30:12 -05:00
psqlscanslash.l Add \if support to pgbench 2018-03-22 17:42:03 +03:00
settings.h Update copyright for 2018 2018-01-02 23:30:12 -05:00
startup.c Avoid misleading psql password prompt when username is multiply specified. 2018-01-29 12:57:09 -05:00
stringutils.c Update copyright for 2018 2018-01-02 23:30:12 -05:00
stringutils.h Update copyright for 2018 2018-01-02 23:30:12 -05:00
tab-complete.c Get rid of explicit argument-count markings in tab-complete.c. 2018-09-21 20:50:41 -04:00
tab-complete.h Update copyright for 2018 2018-01-02 23:30:12 -05:00
variables.c Update copyright for 2018 2018-01-02 23:30:12 -05:00
variables.h Update copyright for 2018 2018-01-02 23:30:12 -05:00