Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd81cd70

Browse files
committed
Standardize output buffer size and display format for strftime;
followup to complaint from Korean User's Group.
1 parent682a6bd commitd81cd70

File tree

4 files changed

+14
-15
lines changed

4 files changed

+14
-15
lines changed

‎contrib/pg_autovacuum/pg_autovacuum.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,20 @@
55
*/
66

77
#include"pg_autovacuum.h"
8-
#defineTIMEBUFF 256
8+
99
FILE*LOGOUTPUT;
10-
chartimebuffer[TIMEBUFF];
1110
charlogbuffer[4096];
1211

1312
void
1413
log_entry(constchar*logentry)
1514
{
1615
time_tcurtime;
1716
structtm*loctime;
17+
chartimebuffer[128];
1818

1919
curtime=time(NULL);
2020
loctime=localtime(&curtime);
21-
strftime(timebuffer,TIMEBUFF,"%Y-%m-%d %r",loctime);/* cbb - %F is not
22-
* always available */
21+
strftime(timebuffer,sizeof(timebuffer),"%Y-%m-%d %H:%M:%S %Z",loctime);
2322
fprintf(LOGOUTPUT,"[%s] %s\n",timebuffer,logentry);
2423
}
2524

‎src/backend/utils/adt/nabstime.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*
1111
*
1212
* IDENTIFICATION
13-
* $PostgreSQL: pgsql/src/backend/utils/adt/nabstime.c,v 1.118 2003/11/29 19:51:58 pgsql Exp $
13+
* $PostgreSQL: pgsql/src/backend/utils/adt/nabstime.c,v 1.119 2004/03/22 15:34:22 tgl Exp $
1414
*
1515
*-------------------------------------------------------------------------
1616
*/
@@ -1724,8 +1724,8 @@ timeofday(PG_FUNCTION_ARGS)
17241724
{
17251725
structtimevaltp;
17261726
structtimezonetpz;
1727-
chartempl[100];
1728-
charbuf[100];
1727+
chartempl[128];
1728+
charbuf[128];
17291729
text*result;
17301730
intlen;
17311731

‎src/backend/utils/error/elog.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
*
3838
*
3939
* IDENTIFICATION
40-
* $PostgreSQL: pgsql/src/backend/utils/error/elog.c,v 1.130 2004/03/21 22:29:11 tgl Exp $
40+
* $PostgreSQL: pgsql/src/backend/utils/error/elog.c,v 1.131 2004/03/22 15:34:22 tgl Exp $
4141
*
4242
*-------------------------------------------------------------------------
4343
*/
@@ -1187,9 +1187,9 @@ log_line_prefix(StringInfo buf)
11871187
case't':
11881188
{
11891189
time_tstamp_time=time(NULL);
1190-
charstrfbuf[32];
1190+
charstrfbuf[128];
11911191

1192-
strftime(strfbuf,sizeof(strfbuf),"%Y-%m-%d %H:%M:%S",
1192+
strftime(strfbuf,sizeof(strfbuf),"%Y-%m-%d %H:%M:%S %Z",
11931193
localtime(&stamp_time));
11941194
appendStringInfoString(buf,strfbuf);
11951195
}
@@ -1198,9 +1198,9 @@ log_line_prefix(StringInfo buf)
11981198
if (MyProcPort)
11991199
{
12001200
time_tstamp_time=MyProcPort->session_start.tv_sec;
1201-
charstrfbuf[32];
1201+
charstrfbuf[128];
12021202

1203-
strftime(strfbuf,sizeof(strfbuf),"%Y-%m-%d %H:%M:%S",
1203+
strftime(strfbuf,sizeof(strfbuf),"%Y-%m-%d %H:%M:%S %Z",
12041204
localtime(&stamp_time));
12051205
appendStringInfoString(buf,strfbuf);
12061206
}

‎src/bin/pg_controldata/pg_controldata.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* copyright (c) Oliver Elphick <olly@lfix.co.uk>, 2001;
77
* licence: BSD
88
*
9-
* $PostgreSQL: pgsql/src/bin/pg_controldata/pg_controldata.c,v 1.13 2004/02/11 22:55:25 tgl Exp $
9+
* $PostgreSQL: pgsql/src/bin/pg_controldata/pg_controldata.c,v 1.14 2004/03/22 15:34:22 tgl Exp $
1010
*/
1111
#include"postgres.h"
1212

@@ -71,8 +71,8 @@ main(int argc, char *argv[])
7171
charControlFilePath[MAXPGPATH];
7272
char*DataDir;
7373
crc64crc;
74-
charpgctime_str[32];
75-
charckpttime_str[32];
74+
charpgctime_str[128];
75+
charckpttime_str[128];
7676
charsysident_str[32];
7777
char*strftime_fmt="%c";
7878
char*progname;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp