Process ID
no
+ |
+ %P
+ Process ID of the parallel group leader, if this process
+ is a parallel query worker
+ no
+
|
%t
Time stamp without milliseconds
character count of the error position therein,
location of the error in the PostgreSQL source code
(if log_error_verbosity is set to verbose),
- application name, and backend type.
+ application name, backend type, and process ID of parallel group leader.
Here is a sample table definition for storing CSV-format log output:
location text,
application_name text,
backend_type text,
+ leader_pid integer,
PRIMARY KEY (session_id, session_line_num)
);
else
appendStringInfo(buf, "%d", MyProcPid);
break;
+
+ case 'P':
+ if (MyProc)
+ {
+ PGPROC *leader = MyProc->lockGroupLeader;
+
+ /*
+ * Show the leader only for active parallel workers. This
+ * leaves out the leader of a parallel group.
+ */
+ if (leader == NULL || leader->pid == MyProcPid)
+ appendStringInfoSpaces(buf,
+ padding > 0 ? padding : -padding);
+ else if (padding != 0)
+ appendStringInfo(buf, "%*d", padding, leader->pid);
+ else
+ appendStringInfo(buf, "%d", leader->pid);
+ }
+ else if (padding != 0)
+ appendStringInfoSpaces(buf,
+ padding > 0 ? padding : -padding);
+ break;
+
case 'l':
if (padding != 0)
appendStringInfo(buf, "%*ld", padding, log_line_number);
else
appendCSVLiteral(&buf, GetBackendTypeDesc(MyBackendType));
+ appendStringInfoChar(&buf, ',');
+
+ /* leader PID */
+ if (MyProc)
+ {
+ PGPROC *leader = MyProc->lockGroupLeader;
+
+ /*
+ * Show the leader only for active parallel workers. This leaves out
+ * the leader of a parallel group.
+ */
+ if (leader && leader->pid != MyProcPid)
+ appendStringInfo(&buf, "%d", leader->pid);
+ }
+
appendStringInfoChar(&buf, '\n');
/* If in the syslogger process, try to write messages direct to file */