77 * Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
88 * Portions Copyright (c) 1994, Regents of the University of California
99 *
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 $
1111 *
1212 *-------------------------------------------------------------------------
1313 */
@@ -271,7 +271,7 @@ typedef struct XLogCtlWrite
271271{
272272XLogwrtResult LogwrtResult ;/* current value of LogwrtResult */
273273int 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 */
275275}XLogCtlWrite ;
276276
277277/*
@@ -1553,7 +1553,7 @@ XLogWrite(XLogwrtRqst WriteRqst, bool flexible, bool xlog_switch)
15531553if (XLogArchivingActive ())
15541554XLogArchiveNotifySeg (openLogId ,openLogSeg );
15551555
1556- Write -> lastSegSwitchTime = time (NULL );
1556+ Write -> lastSegSwitchTime = ( pg_time_t ) time (NULL );
15571557
15581558/*
15591559 * Signal bgwriter to start a checkpoint if we've consumed too
@@ -4217,7 +4217,7 @@ BootStrapXLOG(void)
42174217checkPoint .nextOid = FirstBootstrapObjectId ;
42184218checkPoint .nextMulti = FirstMultiXactId ;
42194219checkPoint .nextMultiOffset = 0 ;
4220- checkPoint .time = time (NULL );
4220+ checkPoint .time = ( pg_time_t ) time (NULL );
42214221
42224222ShmemVariableCache -> nextXid = checkPoint .nextXid ;
42234223ShmemVariableCache -> nextOid = checkPoint .nextOid ;
@@ -4972,7 +4972,7 @@ StartupXLOG(void)
49724972ControlFile -> checkPointCopy = checkPoint ;
49734973if (minRecoveryLoc .xlogid != 0 || minRecoveryLoc .xrecoff != 0 )
49744974ControlFile -> minRecoveryPoint = minRecoveryLoc ;
4975- ControlFile -> time = time (NULL );
4975+ ControlFile -> time = ( pg_time_t ) time (NULL );
49764976UpdateControlFile ();
49774977
49784978/*
@@ -5277,7 +5277,7 @@ StartupXLOG(void)
52775277InRecovery = false;
52785278
52795279ControlFile -> state = DB_IN_PRODUCTION ;
5280- ControlFile -> time = time (NULL );
5280+ ControlFile -> time = ( pg_time_t ) time (NULL );
52815281UpdateControlFile ();
52825282
52835283/* start the archive_timeout timer running */
@@ -5496,10 +5496,10 @@ GetInsertRecPtr(void)
54965496/*
54975497 * Get the time of the last xlog segment switch
54985498 */
5499- time_t
5499+ pg_time_t
55005500GetLastSegSwitchTime (void )
55015501{
5502- time_t result ;
5502+ pg_time_t result ;
55035503
55045504/* Need WALWriteLock, but shared lock is sufficient */
55055505LWLockAcquire (WALWriteLock ,LW_SHARED );
@@ -5676,7 +5676,7 @@ CreateCheckPoint(int flags)
56765676if (shutdown )
56775677{
56785678ControlFile -> state = DB_SHUTDOWNING ;
5679- ControlFile -> time = time (NULL );
5679+ ControlFile -> time = ( pg_time_t ) time (NULL );
56805680UpdateControlFile ();
56815681}
56825682
@@ -5690,7 +5690,7 @@ CreateCheckPoint(int flags)
56905690/* Begin filling in the checkpoint WAL record */
56915691MemSet (& checkPoint ,0 ,sizeof (checkPoint ));
56925692checkPoint .ThisTimeLineID = ThisTimeLineID ;
5693- checkPoint .time = time (NULL );
5693+ checkPoint .time = ( pg_time_t ) time (NULL );
56945694
56955695/*
56965696 * We must hold WALInsertLock while examining insert state to determine
@@ -5891,7 +5891,7 @@ CreateCheckPoint(int flags)
58915891ControlFile -> prevCheckPoint = ControlFile -> checkPoint ;
58925892ControlFile -> checkPoint = ProcLastRecPtr ;
58935893ControlFile -> checkPointCopy = checkPoint ;
5894- ControlFile -> time = time (NULL );
5894+ ControlFile -> time = ( pg_time_t ) time (NULL );
58955895UpdateControlFile ();
58965896LWLockRelease (ControlFileLock );
58975897
@@ -5992,7 +5992,7 @@ RecoveryRestartPoint(const CheckPoint *checkPoint)
59925992 * Checking true elapsed time keeps us from doing restartpoints too often
59935993 * while rapidly scanning large amounts of WAL.
59945994 */
5995- elapsed_secs = time (NULL )- ControlFile -> time ;
5995+ elapsed_secs = ( pg_time_t ) time (NULL )- ControlFile -> time ;
59965996if (elapsed_secs < CheckPointTimeout /2 )
59975997return ;
59985998
@@ -6028,7 +6028,7 @@ RecoveryRestartPoint(const CheckPoint *checkPoint)
60286028ControlFile -> prevCheckPoint = ControlFile -> checkPoint ;
60296029ControlFile -> checkPoint = ReadRecPtr ;
60306030ControlFile -> checkPointCopy = * checkPoint ;
6031- ControlFile -> time = time (NULL );
6031+ ControlFile -> time = ( pg_time_t ) time (NULL );
60326032UpdateControlFile ();
60336033
60346034ereport ((recoveryLogRestartpoints ?LOG :DEBUG2 ),