Thread: pgsql: Support frontend-backend protocol communication using a shm_mq.
Support frontend-backend protocol communication using a shm_mq. A background worker can use pq_redirect_to_shm_mq() to direct protocol that would normally be sent to the frontend to a shm_mq so that another process may read them. The receiving process may use pq_parse_errornotice() to parse an ErrorResponse or NoticeResponse from the background worker and, if it wishes, ThrowErrorData() to propagate the error (with or without further modification). Patch by me. Review by Andres Freund. Branch ------ master Details ------- http://git.postgresql.org/pg/commitdiff/2bd9e412f92bc6a68f3e8bcb18e04955cc35001d Modified Files -------------- src/backend/libpq/Makefile | 2 +- src/backend/libpq/pqcomm.c | 98 ++++++++------ src/backend/libpq/pqmq.c | 261 ++++++++++++++++++++++++++++++++++++++ src/backend/utils/adt/numutils.c | 2 +- src/backend/utils/error/elog.c | 51 ++++++++ src/include/libpq/libpq.h | 36 ++++-- src/include/libpq/pqmq.h | 22 ++++ src/include/utils/builtins.h | 2 +- src/include/utils/elog.h | 1 + 9 files changed, 428 insertions(+), 47 deletions(-)
Re: pgsql: Support frontend-backend protocol communication using a shm_mq.
From
Peter Eisentraut
Date:
On 10/31/14 12:47 PM, Robert Haas wrote: > Support frontend-backend protocol communication using a shm_mq. This fails cpluspluscheck. src/include/libpq/pqmq.h needs to include something that defines StringInfo.
On Sat, Nov 1, 2014 at 9:30 AM, Peter Eisentraut <peter_e@gmx.net> wrote: > On 10/31/14 12:47 PM, Robert Haas wrote: >> Support frontend-backend protocol communication using a shm_mq. > > This fails cpluspluscheck. > > src/include/libpq/pqmq.h needs to include something that defines StringInfo. OK, fixed. On my MacBook Pro, cpluspluscheck is all but useless, because it gives a zillion warnings like this: In file included from src/include/postgres.h:47, from /tmp/cpluspluscheck.ZkYfcq/test.cpp:2: src/include/c.h:110:21: error: libintl.h: No such file or directory I bet that's because I configure --with-libraries=/opt/local/lib --with-includes=/opt/local/include -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company