diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2017-02-23 15:57:08 -0500 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2017-02-23 15:57:08 -0500 |
commit | c29aff959dc64f7321062e7f33d8c6ec23db53d3 (patch) | |
tree | 4c3efa167e01805b2e4fcd6eead2e1a320a2c420 /src/bin/pg_basebackup/pg_recvlogical.c | |
parent | b9d092c962ea3262930e3c31a8c3d79b66ce9d43 (diff) |
Consistently declare timestamp variables as TimestampTz.
Twiddle the replication-related code so that its timestamp variables
are declared TimestampTz, rather than the uninformative "int64" that
was previously used for meant-to-be-always-integer timestamps.
This resolves the int64-vs-TimestampTz declaration inconsistencies
introduced by commit 7c030783a, though in the opposite direction to
what was originally suggested.
This required including datatype/timestamp.h in a couple more places
than before. I decided it would be a good idea to slim down that
header by not having it pull in <float.h> etc, as those headers are
no longer at all relevant to its purpose. Unsurprisingly, a small number
of .c files turn out to have been depending on those inclusions, so add
them back in the .c files as needed.
Discussion: https://postgr.es/m/26788.1487455319@sss.pgh.pa.us
Discussion: https://postgr.es/m/27694.1487456324@sss.pgh.pa.us
Diffstat (limited to 'src/bin/pg_basebackup/pg_recvlogical.c')
-rw-r--r-- | src/bin/pg_basebackup/pg_recvlogical.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/bin/pg_basebackup/pg_recvlogical.c b/src/bin/pg_basebackup/pg_recvlogical.c index d16d08b664d..6b081bd7372 100644 --- a/src/bin/pg_basebackup/pg_recvlogical.c +++ b/src/bin/pg_basebackup/pg_recvlogical.c @@ -57,7 +57,7 @@ static int outfd = -1; static volatile sig_atomic_t time_to_abort = false; static volatile sig_atomic_t output_reopen = false; static bool output_isfile; -static int64 output_last_fsync = -1; +static TimestampTz output_last_fsync = -1; static bool output_needs_fsync = false; static XLogRecPtr output_written_lsn = InvalidXLogRecPtr; static XLogRecPtr output_fsync_lsn = InvalidXLogRecPtr; @@ -112,7 +112,7 @@ usage(void) * Send a Standby Status Update message to server. */ static bool -sendFeedback(PGconn *conn, int64 now, bool force, bool replyRequested) +sendFeedback(PGconn *conn, TimestampTz now, bool force, bool replyRequested) { static XLogRecPtr last_written_lsn = InvalidXLogRecPtr; static XLogRecPtr last_fsync_lsn = InvalidXLogRecPtr; @@ -175,7 +175,7 @@ disconnect_and_exit(int code) } static bool -OutputFsync(int64 now) +OutputFsync(TimestampTz now) { output_last_fsync = now; @@ -212,7 +212,7 @@ StreamLogicalLog(void) { PGresult *res; char *copybuf = NULL; - int64 last_status = -1; + TimestampTz last_status = -1; int i; PQExpBuffer query; @@ -285,7 +285,7 @@ StreamLogicalLog(void) int r; int bytes_left; int bytes_written; - int64 now; + TimestampTz now; int hdr_len; XLogRecPtr cur_record_lsn = InvalidXLogRecPtr; @@ -365,8 +365,8 @@ StreamLogicalLog(void) * response back to the client. */ fd_set input_mask; - int64 message_target = 0; - int64 fsync_target = 0; + TimestampTz message_target = 0; + TimestampTz fsync_target = 0; struct timeval timeout; struct timeval *timeoutptr = NULL; @@ -394,7 +394,7 @@ StreamLogicalLog(void) /* Now compute when to wakeup. */ if (message_target > 0 || fsync_target > 0) { - int64 targettime; + TimestampTz targettime; long secs; int usecs; @@ -622,7 +622,7 @@ StreamLogicalLog(void) if (outfd != -1 && strcmp(outfile, "-") != 0) { - int64 t = feGetCurrentTimestamp(); + TimestampTz t = feGetCurrentTimestamp(); /* no need to jump to error on failure here, we're finishing anyway */ OutputFsync(t); |