From cd004067742ee16ee63e55abfb4acbd5f09fbaab Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sun, 17 Feb 2008 02:09:32 +0000 Subject: Replace time_t with pg_time_t (same values, but always int64) in on-disk data structures and backend internal APIs. This solves problems we've seen recently with inconsistent layout of pg_control between machines that have 32-bit time_t and those that have already migrated to 64-bit time_t. Also, we can get out from under the problem that Windows' Unix-API emulation is not consistent about the width of time_t. There are a few remaining places where local time_t variables are used to hold the current or recent result of time(NULL). I didn't bother changing these since they do not affect any cross-module APIs and surely all platforms will have 64-bit time_t before overflow becomes an actual risk. time_t should be avoided for anything visible to extension modules, however. --- src/include/miscadmin.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/include/miscadmin.h') diff --git a/src/include/miscadmin.h b/src/include/miscadmin.h index 6ded4c9bc4c..75a7e1f7f7c 100644 --- a/src/include/miscadmin.h +++ b/src/include/miscadmin.h @@ -13,7 +13,7 @@ * Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/miscadmin.h,v 1.199 2008/01/03 21:23:15 tgl Exp $ + * $PostgreSQL: pgsql/src/include/miscadmin.h,v 1.200 2008/02/17 02:09:31 tgl Exp $ * * NOTES * some of the information in this file should be moved to other files. @@ -23,7 +23,7 @@ #ifndef MISCADMIN_H #define MISCADMIN_H -#include /* for time_t */ +#include "pgtime.h" /* for pg_time_t */ #define PG_VERSIONSTR "postgres (PostgreSQL) " PG_VERSION "\n" @@ -134,7 +134,7 @@ extern int MaxBackends; extern int MaxConnections; extern PGDLLIMPORT int MyProcPid; -extern PGDLLIMPORT time_t MyStartTime; +extern PGDLLIMPORT pg_time_t MyStartTime; extern PGDLLIMPORT struct Port *MyProcPort; extern long MyCancelKey; -- cgit v1.2.3