Thread: pgsql: Fix commit_ts for FrozenXid and BootstrapXid

pgsql: Fix commit_ts for FrozenXid and BootstrapXid

From
Alvaro Herrera
Date:
Fix commit_ts for FrozenXid and BootstrapXid

Previously, requesting commit timestamp for transactions
FrozenTransactionId and BootstrapTransactionId resulted in an error.
But since those values can validly appear in committed tuples' Xmin,
this behavior is unhelpful and error prone: each caller would have to
special-case those values before requesting timestamp data for an Xid.
We already have a perfectly good interface for returning "the Xid you
requested is too old for us to have commit TS data for it", so let's use
that instead.

Backpatch to 9.5, where commit timestamps appeared.

Author: Craig Ringer
Discussion: https://www.postgresql.org/message-id/CAMsr+YFM5Q=+ry3mKvWEqRTxrB0iU3qUSRnS28nz6FJYtBwhJg@mail.gmail.com

Branch
------
REL9_6_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/9b66342901f2a3845fe2b44c647bb1316220975c

Modified Files
--------------
src/backend/access/transam/commit_ts.c                     | 11 +++++++++--
src/test/modules/commit_ts/expected/commit_timestamp.out   | 12 ++++++++++--
src/test/modules/commit_ts/expected/commit_timestamp_1.out | 12 ++++++++++--
src/test/modules/commit_ts/t/004_restart.pl                | 14 ++++----------
4 files changed, 33 insertions(+), 16 deletions(-)