1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-07 00:36:50 +03:00

Move session_start out of MyProcPort stucture and make it a global called MyStartTime,

so that we will be able to create a cookie for all processes for CSVlogs.
It is set wherever MyProcPid is set. Take the opportunity to remove the now
unnecessary session-only restriction on the %s and %c escapes in log_line_prefix.
This commit is contained in:
Andrew Dunstan
2007-08-02 23:39:45 +00:00
parent b34903453f
commit 63872601e8
12 changed files with 45 additions and 24 deletions

View File

@ -42,7 +42,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/error/elog.c,v 1.190 2007/07/21 22:12:04 tgl Exp $
* $PostgreSQL: pgsql/src/backend/utils/error/elog.c,v 1.191 2007/08/02 23:39:44 adunstan Exp $
*
*-------------------------------------------------------------------------
*/
@ -1485,12 +1485,7 @@ log_line_prefix(StringInfo buf)
}
break;
case 'c':
if (MyProcPort)
{
appendStringInfo(buf, "%lx.%x",
(long) (MyProcPort->session_start),
MyProcPid);
}
appendStringInfo(buf, "%lx.%x", (long)(MyStartTime),MyProcPid);
break;
case 'p':
appendStringInfo(buf, "%d", MyProcPid);
@ -1552,7 +1547,6 @@ log_line_prefix(StringInfo buf)
}
break;
case 's':
if (MyProcPort)
{
char strfbuf[128];
@ -1563,7 +1557,7 @@ log_line_prefix(StringInfo buf)
#else
"%Y-%m-%d %H:%M:%S",
#endif
localtime(&MyProcPort->session_start));
localtime(&MyStartTime));
appendStringInfoString(buf, strfbuf);
}
break;