switch (msgtype)
{
- case PqMsg_BackendKeyData:
- {
- int32 pid = pq_getmsgint(msg, 4);
-
- (void) pq_getmsgint(msg, 4); /* discard cancel key */
- (void) pq_getmsgend(msg);
- pcxt->worker[i].pid = pid;
- break;
- }
-
case PqMsg_ErrorResponse:
case PqMsg_NoticeResponse:
{
char *relmapperspace;
char *uncommittedenumsspace;
char *clientconninfospace;
- StringInfoData msgbuf;
char *session_dsm_handle_space;
Snapshot tsnapshot;
Snapshot asnapshot;
pq_set_parallel_leader(fps->parallel_leader_pid,
fps->parallel_leader_proc_number);
- /*
- * Send a BackendKeyData message to the process that initiated parallelism
- * so that it has access to our PID before it receives any other messages
- * from us. Our cancel key is sent, too, since that's the way the
- * protocol message is defined, but it won't actually be used for anything
- * in this case.
- */
- pq_beginmessage(&msgbuf, PqMsg_BackendKeyData);
- pq_sendint32(&msgbuf, (int32) MyProcPid);
- pq_sendint32(&msgbuf, (int32) MyCancelKey);
- pq_endmessage(&msgbuf);
-
/*
* Hooray! Primary initialization is complete. Now, we need to set up our
* backend-local state to match the original backend.