From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Code review for commit 05a7be935.
Date: Thu, 26 Jan 2023 17:51:07 +0000
Message-ID: <E1pL6Ow-0003Cj-GJ@gemulon.postgresql.org> (raw)
Code review for commit 05a7be935.
Avoid having walreceiver code know explicitly about the precision
and underlying datatype of TimestampTz. (There is still one
calculation that knows that, which should be replaced with use of
TimestampDifferenceMilliseconds; but we need to figure out what to do
about overflow cases first.)
In support of this, provide a TimestampTzPlusSeconds macro, as well
as TIMESTAMP_INFINITY and TIMESTAMP_MINUS_INFINITY macros. (We could
have used the existing DT_NOEND and DT_NOBEGIN symbols, but I judged
those too opaque and confusing.)
Move GetCurrentTimestamp calls so that it's more obvious that we
are not using stale values of "now" anyplace. This doesn't result
in net more calls, and might indeed make for net fewer.
Avoid having a dummy value in the WalRcvWakeupReason enum, so that
we can hope for the compiler to catch overlooked switch cases.
Nathan Bossart and Tom Lane
Discussion: https://postgr.es/m/20230125235004.GA1327755@nathanxps13
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/24ff700f6aee2e8b915399e03934c6fe9b593d3f
Modified Files
--------------
src/backend/replication/walreceiver.c | 47 ++++++++++++++++++-----------------
src/include/datatype/timestamp.h | 13 +++++++---
src/include/utils/timestamp.h | 2 ++
3 files changed, 36 insertions(+), 26 deletions(-)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: tgl@sss.pgh.pa.us
Subject: Re: pgsql: Code review for commit 05a7be935.
In-Reply-To: <E1pL6Ow-0003Cj-GJ@gemulon.postgresql.org>
References: <E1pL6Ow-0003Cj-GJ@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox