Read toast chunks in ascending order, looping if required
authorChristoph Berg <myon@debian.org>
Tue, 15 Apr 2025 17:11:33 +0000 (17:11 +0000)
committerChristoph Berg <myon@debian.org>
Tue, 15 Apr 2025 17:21:24 +0000 (17:21 +0000)
commit3819e05092fc44a416837d682a3c3698a642d1e5
tree6cfe67be2d4be7556c758478737d131eedd25cea
parent549383ae33266c586549e8c6789b51c8cfc93b2a
Read toast chunks in ascending order, looping if required

Toast chunks might be stored out-of-order in the table. We previously
ignored that and hoped for the best, but our toast.sql test actually
exhibits the problem on pre-14 servers where the 5th chunk of the last
test is small enough to fit into the first disk block.

Fix by looping over the table until all chunks have been read. A smarter
solution would require either toast index lookups or caching the chunks.

Close #20.

Author: Christoph Berg <myon@debian.org>
Debugging-By: Svetlana Derevyanko <s.derevyanko@postgrespro.ru>
decode.c
decode.h
expected/toast_4.out
pg_filedump.c
pg_filedump.h