1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-12 05:01:15 +03:00

Standardize output buffer size and display format for strftime;

followup to complaint from Korean User's Group.
This commit is contained in:
Tom Lane
2004-03-22 15:34:22 +00:00
parent 682a6bd5eb
commit d81cd7032e
4 changed files with 14 additions and 15 deletions

View File

@@ -10,7 +10,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/adt/nabstime.c,v 1.118 2003/11/29 19:51:58 pgsql Exp $
* $PostgreSQL: pgsql/src/backend/utils/adt/nabstime.c,v 1.119 2004/03/22 15:34:22 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -1724,8 +1724,8 @@ timeofday(PG_FUNCTION_ARGS)
{
struct timeval tp;
struct timezone tpz;
char templ[100];
char buf[100];
char templ[128];
char buf[128];
text *result;
int len;

View File

@@ -37,7 +37,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/error/elog.c,v 1.130 2004/03/21 22:29:11 tgl Exp $
* $PostgreSQL: pgsql/src/backend/utils/error/elog.c,v 1.131 2004/03/22 15:34:22 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -1187,9 +1187,9 @@ log_line_prefix(StringInfo buf)
case 't':
{
time_t stamp_time = time(NULL);
char strfbuf[32];
char strfbuf[128];
strftime(strfbuf, sizeof(strfbuf), "%Y-%m-%d %H:%M:%S",
strftime(strfbuf, sizeof(strfbuf), "%Y-%m-%d %H:%M:%S %Z",
localtime(&stamp_time));
appendStringInfoString(buf, strfbuf);
}
@@ -1198,9 +1198,9 @@ log_line_prefix(StringInfo buf)
if (MyProcPort)
{
time_t stamp_time = MyProcPort->session_start.tv_sec;
char strfbuf[32];
char strfbuf[128];
strftime(strfbuf, sizeof(strfbuf), "%Y-%m-%d %H:%M:%S",
strftime(strfbuf, sizeof(strfbuf), "%Y-%m-%d %H:%M:%S %Z",
localtime(&stamp_time));
appendStringInfoString(buf, strfbuf);
}