Support frontend-backend protocol communication using a shm_mq.
authorRobert Haas <rhaas@postgresql.org>
Fri, 31 Oct 2014 16:02:40 +0000 (12:02 -0400)
committerRobert Haas <rhaas@postgresql.org>
Fri, 31 Oct 2014 16:02:40 +0000 (12:02 -0400)
commit2bd9e412f92bc6a68f3e8bcb18e04955cc35001d
tree9a4a8dc45c5761aa0554d7f1ba255d5e599150b5
parent252e652edea80b948fbc9c3723183065e94d8480
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.
src/backend/libpq/Makefile
src/backend/libpq/pqcomm.c
src/backend/libpq/pqmq.c [new file with mode: 0644]
src/backend/utils/adt/numutils.c
src/backend/utils/error/elog.c
src/include/libpq/libpq.h
src/include/libpq/pqmq.h [new file with mode: 0644]
src/include/utils/builtins.h
src/include/utils/elog.h