character count of the error position therein,
location of the error in the PostgreSQL source code
(if <varname>log_error_verbosity</varname> is set to <literal>verbose</literal>),
- application name, backend type, and process ID of parallel group leader.
+ application name, backend type, process ID of parallel group leader,
+ and query id.
Here is a sample table definition for storing CSV-format log output:
<programlisting>
application_name text,
backend_type text,
leader_pid integer,
+ query_id bigint,
PRIMARY KEY (session_id, session_line_num)
);
</programlisting>
break;
case 'Q':
if (padding != 0)
- appendStringInfo(buf, "%*ld", padding,
- pgstat_get_my_queryid());
+ appendStringInfo(buf, "%*lld", padding,
+ (long long) pgstat_get_my_queryid());
else
- appendStringInfo(buf, "%ld",
- pgstat_get_my_queryid());
+ appendStringInfo(buf, "%lld",
+ (long long) pgstat_get_my_queryid());
break;
default:
/* format error - ignore it */
if (leader && leader->pid != MyProcPid)
appendStringInfo(&buf, "%d", leader->pid);
}
+ appendStringInfoChar(&buf, ',');
+
+ /* query id */
+ appendStringInfo(&buf, "%lld", (long long) pgstat_get_my_queryid());
appendStringInfoChar(&buf, '\n');