Replace time_t with pg_time_t (same values, but always int64) in on-disk
authorTom Lane <tgl@sss.pgh.pa.us>
Sun, 17 Feb 2008 02:09:32 +0000 (02:09 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Sun, 17 Feb 2008 02:09:32 +0000 (02:09 +0000)
commitd1956d7c3911dbc4fd349103b0fdd06de8d89968
treeeae88e90bd0158e7b228b998be7b5473aaee8917
parentea3612610edaeaacb1d22972e82cdf4ae5fab4be
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.
17 files changed:
contrib/pgcrypto/internal.c
src/backend/access/transam/xlog.c
src/backend/postmaster/bgwriter.c
src/backend/postmaster/syslogger.c
src/backend/utils/adt/date.c
src/backend/utils/adt/datetime.c
src/backend/utils/adt/nabstime.c
src/backend/utils/adt/timestamp.c
src/backend/utils/init/globals.c
src/bin/pg_controldata/pg_controldata.c
src/bin/pg_resetxlog/pg_resetxlog.c
src/include/access/xlog_internal.h
src/include/catalog/pg_control.h
src/include/miscadmin.h
src/include/port/win32.h
src/include/utils/timestamp.h
src/tools/msvc/Project.pm