Reject currtid2() on unlogged tables during recovery.

Commit 1e707d32564 made COPY TO report a proper error for unlogged
tables during recovery. currtid2() has the same problem: it reads the
table directly without going through the planner, so on a standby it
failed with a low-level error for an unlogged table:

ERROR:  could not open file "base/5/16384": No such file or directory

Check for this case and report the same error as SELECT. No test is
added, as currtid2() is an undocumented internal function.

Backpatch to all supported versions, like commit 1e707d32564.

Reported-by: Masahiko Sawada <[email protected]>
Author: Jim Jones <[email protected]>
Discussion: 
https://postgr.es/m/cad21aodna7pl760_23an_wypmkwxct+kw0_vjacci4r5doc...@mail.gmail.com
Backpatch-through: 14

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/fded90eec3ebab14a327a3c40263e2366eb3c42a

Modified Files
--------------
src/backend/utils/adt/tid.c | 7 +++++++
1 file changed, 7 insertions(+)

Reply via email to