postgresql/src/interfaces/libpq
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
test Prevent accidental linking of system-supplied copies of libpq.so etc. 2018-04-03 16:26:05 -04:00
.gitignore Build src/common files as a library with -fPIC. 2018-09-28 14:28:19 -04:00
exports.txt Remove pqsignal() from libpq's official exports list. 2018-09-28 12:38:10 -04:00
fe-auth-scram.c Minor cleanup/future-proofing for pg_saslprep(). 2018-09-08 18:20:36 -04:00
fe-auth.c Incorporate strerror_r() into src/port/snprintf.c, too. 2018-09-26 12:35:57 -04:00
fe-auth.h Refactor channel binding code to fetch cbind_data only when necessary 2018-01-04 13:55:12 -05:00
fe-connect.c Incorporate strerror_r() into src/port/snprintf.c, too. 2018-09-26 12:35:57 -04:00
fe-exec.c Client-side fixes for delayed NOTIFY receipt. 2018-10-19 22:22:57 -04:00
fe-lobj.c Incorporate strerror_r() into src/port/snprintf.c, too. 2018-09-26 12:35:57 -04:00
fe-misc.c Incorporate strerror_r() into src/port/snprintf.c, too. 2018-09-26 12:35:57 -04:00
fe-print.c Update copyright for 2018 2018-01-02 23:30:12 -05:00
fe-protocol2.c In libpq, free any partial query result before collecting a server error. 2018-04-13 12:53:45 -04:00
fe-protocol3.c In libpq, free any partial query result before collecting a server error. 2018-04-13 12:53:45 -04:00
fe-secure-common.c Change libpq's internal uses of PQhost() to inspect host field directly. 2018-08-03 12:12:10 -04:00
fe-secure-common.h Refactor client-side SSL certificate checking code 2018-01-30 22:56:24 -05:00
fe-secure-openssl.c Incorporate strerror_r() into src/port/snprintf.c, too. 2018-09-26 12:35:57 -04:00
fe-secure.c Incorporate strerror_r() into src/port/snprintf.c, too. 2018-09-26 12:35:57 -04:00
libpq-events.c Update copyright for 2018 2018-01-02 23:30:12 -05:00
libpq-events.h Update copyright for 2018 2018-01-02 23:30:12 -05:00
libpq-fe.h Add PQresultMemorySize function to report allocated size of a PGresult. 2018-09-11 18:45:12 -04:00
libpq-int.h Incorporate strerror_r() into src/port/snprintf.c, too. 2018-09-26 12:35:57 -04:00
libpq.rc.in Stamp HEAD as 12devel 2018-06-30 12:47:59 -04:00
Makefile Tweak MSVC build system to match changes in 7143b3e82. 2018-09-28 15:17:07 -04:00
nls.mk Refactor client-side SSL certificate checking code 2018-01-30 22:56:24 -05:00
pg_service.conf.sample Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
pqexpbuffer.c Implement %m in src/port/snprintf.c, and teach elog.c to rely on that. 2018-09-26 13:31:56 -04:00
pqexpbuffer.h Update copyright for 2018 2018-01-02 23:30:12 -05:00
pthread-win32.c Update copyright for 2018 2018-01-02 23:30:12 -05:00
README Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
win32.c Update copyright for 2018 2018-01-02 23:30:12 -05:00
win32.h Remove support for bcc and msvc standalone libpq builds 2017-04-11 15:22:21 +02:00

src/interfaces/libpq/README

This directory contains the C version of Libpq, the POSTGRES frontend library.