MCPcopy Create free account
hub / github.com/apache/cloudberry / feGetCurrentTimestamp

Function feGetCurrentTimestamp

src/bin/pg_basebackup/streamutil.c:608–621  ·  view source on GitHub ↗

* Frontend version of GetCurrentTimestamp(), since we are not linked with * backend code. */

Source from the content-addressed store, hash-verified

606 * backend code.
607 */
608TimestampTz
609feGetCurrentTimestamp(void)
610{
611 TimestampTz result;
612 struct timeval tp;
613
614 gettimeofday(&tp, NULL);
615
616 result = (TimestampTz) tp.tv_sec -
617 ((POSTGRES_EPOCH_JDATE - UNIX_EPOCH_JDATE) * SECS_PER_DAY);
618 result = (result * USECS_PER_SEC) + tp.tv_usec;
619
620 return result;
621}
622
623/*
624 * Frontend version of TimestampDifference(), since we are not linked with

Callers 4

StreamLogicalLogFunction · 0.85
flushAndSendFeedbackFunction · 0.85
HandleCopyStreamFunction · 0.85
ProcessKeepaliveMsgFunction · 0.85

Calls 1

gettimeofdayFunction · 0.85

Tested by

no test coverage detected