tableam: New callback relation_fetch_toast_slice.
authorRobert Haas <rhaas@postgresql.org>
Tue, 7 Jan 2020 19:35:48 +0000 (14:35 -0500)
committerRobert Haas <rhaas@postgresql.org>
Tue, 7 Jan 2020 19:36:38 +0000 (14:36 -0500)
commitce242ae154dde3217971c6f262705d80999f4e00
treeb27d011a88c2c4037a76b6c901d8af0654050f86
parent83322e38da1aa054e1b144cb37e6074a86854199
tableam: New callback relation_fetch_toast_slice.

Instead of always calling heap_fetch_toast_slice during detoasting,
invoke a table AM callback which, when the toast table is a heap
table, will be heap_fetch_toast_slice.

This makes it possible for a table AM other than heap to be used
as a TOAST table. It also completes the series of commits intended
to improve the interaction of tableam with TOAST that began with
commit 8b94dab06617ef80a0901ab103ebd8754427ef5a; detoast.c is
now, hopefully, fully AM-independent.

Patch by me, reviewed by Andres Freund and Peter Eisentraut.

Discussion: http://postgr.es/m/CA+TgmoZv-=2iWM4jcw5ZhJeL18HF96+W1yJeYrnGMYdkFFnEpQ@mail.gmail.com
src/backend/access/common/detoast.c
src/backend/access/heap/heapam_handler.c
src/backend/access/heap/heaptoast.c
src/include/access/heaptoast.h
src/include/access/tableam.h