1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-15 19:21:59 +03:00

This patch from Alvaro Herrera adds transaction ID to the list of

log_line_prefix escapes. The escape sequence used for this is %x.
%x previously meant "postmaster et al. stop here" -- this has been
renamed to %q.
This commit is contained in:
Neil Conway
2004-09-22 03:55:27 +00:00
parent 665d3736fb
commit a3c53c834f
3 changed files with 20 additions and 6 deletions

View File

@ -42,7 +42,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/error/elog.c,v 1.150 2004/09/05 03:42:11 tgl Exp $
* $PostgreSQL: pgsql/src/backend/utils/error/elog.c,v 1.151 2004/09/22 03:55:26 neilc Exp $
*
*-------------------------------------------------------------------------
*/
@ -1421,12 +1421,21 @@ log_line_prefix(StringInfo buf)
MyProcPort->remote_port);
}
break;
case 'x':
/* in postmaster and friends, stop if %x is seen */
case 'q':
/* in postmaster and friends, stop if %q is seen */
/* in a backend, just ignore */
if (MyProcPort == NULL)
i = format_len;
break;
case 'x':
if (MyProcPort)
{
if (IsTransactionState())
appendStringInfo(buf, "%u", GetTopTransactionId());
else
appendStringInfo(buf, "%u", InvalidTransactionId);
}
break;
case '%':
appendStringInfoChar(buf, '%');
break;