7
7
* Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
8
8
* Portions Copyright (c) 1994, Regents of the University of California
9
9
*
10
- * $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.292 2008/01/21 11:17:46 petere Exp $
10
+ * $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.293 2008/02/17 02:09:27 tgl Exp $
11
11
*
12
12
*-------------------------------------------------------------------------
13
13
*/
@@ -271,7 +271,7 @@ typedef struct XLogCtlWrite
271
271
{
272
272
XLogwrtResult LogwrtResult ; /* current value of LogwrtResult */
273
273
int curridx ; /* cache index of next block to write */
274
- time_t lastSegSwitchTime ; /* time of last xlog segment switch */
274
+ pg_time_t lastSegSwitchTime ; /* time of last xlog segment switch */
275
275
} XLogCtlWrite ;
276
276
277
277
/*
@@ -1553,7 +1553,7 @@ XLogWrite(XLogwrtRqst WriteRqst, bool flexible, bool xlog_switch)
1553
1553
if (XLogArchivingActive ())
1554
1554
XLogArchiveNotifySeg (openLogId , openLogSeg );
1555
1555
1556
- Write -> lastSegSwitchTime = time (NULL );
1556
+ Write -> lastSegSwitchTime = ( pg_time_t ) time (NULL );
1557
1557
1558
1558
/*
1559
1559
* Signal bgwriter to start a checkpoint if we've consumed too
@@ -4217,7 +4217,7 @@ BootStrapXLOG(void)
4217
4217
checkPoint .nextOid = FirstBootstrapObjectId ;
4218
4218
checkPoint .nextMulti = FirstMultiXactId ;
4219
4219
checkPoint .nextMultiOffset = 0 ;
4220
- checkPoint .time = time (NULL );
4220
+ checkPoint .time = ( pg_time_t ) time (NULL );
4221
4221
4222
4222
ShmemVariableCache -> nextXid = checkPoint .nextXid ;
4223
4223
ShmemVariableCache -> nextOid = checkPoint .nextOid ;
@@ -4972,7 +4972,7 @@ StartupXLOG(void)
4972
4972
ControlFile -> checkPointCopy = checkPoint ;
4973
4973
if (minRecoveryLoc .xlogid != 0 || minRecoveryLoc .xrecoff != 0 )
4974
4974
ControlFile -> minRecoveryPoint = minRecoveryLoc ;
4975
- ControlFile -> time = time (NULL );
4975
+ ControlFile -> time = ( pg_time_t ) time (NULL );
4976
4976
UpdateControlFile ();
4977
4977
4978
4978
/*
@@ -5277,7 +5277,7 @@ StartupXLOG(void)
5277
5277
InRecovery = false;
5278
5278
5279
5279
ControlFile -> state = DB_IN_PRODUCTION ;
5280
- ControlFile -> time = time (NULL );
5280
+ ControlFile -> time = ( pg_time_t ) time (NULL );
5281
5281
UpdateControlFile ();
5282
5282
5283
5283
/* start the archive_timeout timer running */
@@ -5496,10 +5496,10 @@ GetInsertRecPtr(void)
5496
5496
/*
5497
5497
* Get the time of the last xlog segment switch
5498
5498
*/
5499
- time_t
5499
+ pg_time_t
5500
5500
GetLastSegSwitchTime (void )
5501
5501
{
5502
- time_t result ;
5502
+ pg_time_t result ;
5503
5503
5504
5504
/* Need WALWriteLock, but shared lock is sufficient */
5505
5505
LWLockAcquire (WALWriteLock , LW_SHARED );
@@ -5676,7 +5676,7 @@ CreateCheckPoint(int flags)
5676
5676
if (shutdown )
5677
5677
{
5678
5678
ControlFile -> state = DB_SHUTDOWNING ;
5679
- ControlFile -> time = time (NULL );
5679
+ ControlFile -> time = ( pg_time_t ) time (NULL );
5680
5680
UpdateControlFile ();
5681
5681
}
5682
5682
@@ -5690,7 +5690,7 @@ CreateCheckPoint(int flags)
5690
5690
/* Begin filling in the checkpoint WAL record */
5691
5691
MemSet (& checkPoint , 0 , sizeof (checkPoint ));
5692
5692
checkPoint .ThisTimeLineID = ThisTimeLineID ;
5693
- checkPoint .time = time (NULL );
5693
+ checkPoint .time = ( pg_time_t ) time (NULL );
5694
5694
5695
5695
/*
5696
5696
* We must hold WALInsertLock while examining insert state to determine
@@ -5891,7 +5891,7 @@ CreateCheckPoint(int flags)
5891
5891
ControlFile -> prevCheckPoint = ControlFile -> checkPoint ;
5892
5892
ControlFile -> checkPoint = ProcLastRecPtr ;
5893
5893
ControlFile -> checkPointCopy = checkPoint ;
5894
- ControlFile -> time = time (NULL );
5894
+ ControlFile -> time = ( pg_time_t ) time (NULL );
5895
5895
UpdateControlFile ();
5896
5896
LWLockRelease (ControlFileLock );
5897
5897
@@ -5992,7 +5992,7 @@ RecoveryRestartPoint(const CheckPoint *checkPoint)
5992
5992
* Checking true elapsed time keeps us from doing restartpoints too often
5993
5993
* while rapidly scanning large amounts of WAL.
5994
5994
*/
5995
- elapsed_secs = time (NULL ) - ControlFile -> time ;
5995
+ elapsed_secs = ( pg_time_t ) time (NULL ) - ControlFile -> time ;
5996
5996
if (elapsed_secs < CheckPointTimeout / 2 )
5997
5997
return ;
5998
5998
@@ -6028,7 +6028,7 @@ RecoveryRestartPoint(const CheckPoint *checkPoint)
6028
6028
ControlFile -> prevCheckPoint = ControlFile -> checkPoint ;
6029
6029
ControlFile -> checkPoint = ReadRecPtr ;
6030
6030
ControlFile -> checkPointCopy = * checkPoint ;
6031
- ControlFile -> time = time (NULL );
6031
+ ControlFile -> time = ( pg_time_t ) time (NULL );
6032
6032
UpdateControlFile ();
6033
6033
6034
6034
ereport ((recoveryLogRestartpoints ? LOG : DEBUG2 ),
0 commit comments