postgresql/src/backend
Tom Lane bd037dc928 Make XLogRecGetBlockTag() throw error if there's no such block.
All but a few existing callers assume without checking that this
function succeeds.  While it probably will, that's a poor excuse for
not checking.  Let's make it return void and instead throw an error
if it doesn't find the block reference.  Callers that actually need
to handle the no-such-block case must now use the underlying function
XLogRecGetBlockTagExtended.

In addition to being a bit less error-prone, this should also serve
to suppress some Coverity complaints about XLogRecGetBlockRefInfo.

While at it, clean up some inconsistency about use of the
XLogRecHasBlockRef macro: make XLogRecGetBlockTagExtended use
that instead of open-coding the same condition, and avoid calling
XLogRecHasBlockRef twice in relevant code paths.  (That is,
calling XLogRecHasBlockRef followed by XLogRecGetBlockTag is now
deprecated: use XLogRecGetBlockTagExtended instead.)

Patch HEAD only; this doesn't seem to have enough value to consider
a back-branch API break.

Discussion: https://postgr.es/m/425039.1649701221@sss.pgh.pa.us
2022-04-11 17:43:53 -04:00
..
access Make XLogRecGetBlockTag() throw error if there's no such block. 2022-04-11 17:43:53 -04:00
bootstrap pg_upgrade: Preserve relfilenodes and tablespace OIDs. 2022-01-17 13:40:27 -05:00
catalog Rename delayChkpt to delayChkptFlags. 2022-04-08 11:44:17 -04:00
commands Fix various typos and spelling mistakes in code comments 2022-04-11 20:49:41 +12:00
executor Fix various typos and spelling mistakes in code comments 2022-04-11 20:49:41 +12:00
foreign Create routine able to set single-call SRFs for Materialize mode 2022-03-07 10:26:29 +09:00
jit SQL/JSON query functions 2022-03-29 16:57:13 -04:00
lib dshash: revise sequential scan support. 2022-04-04 14:32:52 -07:00
libpq Remove error message hints mentioning configure options 2022-04-08 07:41:55 +02:00
main Fix collection of typos in the code and the documentation 2022-03-15 11:29:35 +09:00
nodes Teach planner and executor about monotonic window funcs 2022-04-08 10:34:36 +12:00
optimizer Fix various typos and spelling mistakes in code comments 2022-04-11 20:49:41 +12:00
parser Fix various typos and spelling mistakes in code comments 2022-04-11 20:49:41 +12:00
partitioning Refactor and cleanup runtime partition prune code a little 2022-04-05 11:46:48 +02:00
po Translation updates 2021-06-21 12:33:50 +02:00
port Ensure that the argument of shmdt(2) is declared "void *". 2022-02-15 17:17:28 -05:00
postmaster Custom WAL Resource Managers. 2022-04-06 23:06:46 -07:00
regex Call pg_newlocale_from_collation() also with default collation 2022-01-20 09:50:18 +01:00
replication Fix various typos and spelling mistakes in code comments 2022-04-11 20:49:41 +12:00
rewrite Add support for MERGE SQL command 2022-03-28 16:47:48 +02:00
snowball Update copyright for 2022 2022-01-07 19:04:57 -05:00
statistics Fix various typos, grammar and code style in comments and docs 2022-01-25 09:40:04 +09:00
storage Fix various typos and spelling mistakes in code comments 2022-04-11 20:49:41 +12:00
tcop pgstat: store statistics in shared memory. 2022-04-06 21:29:46 -07:00
tsearch Fix various typos and spelling mistakes in code comments 2022-04-11 20:49:41 +12:00
utils Explicitly ignore guaranteed-true result from pgstat_lock_entry(). 2022-04-11 13:22:37 -04:00
.gitignore Add .gitignore entries for AIX-specific intermediate build artifacts. 2015-07-08 20:44:22 -04:00
Makefile Server-side gzip compression. 2022-01-24 15:13:18 -05:00
common.mk Remove PARTIAL_LINKING build mode. 2018-03-30 17:33:04 -07:00
nls.mk Report progress of startup operations that take a long time. 2021-10-25 11:51:57 -04:00