Detoasting
Detoasting retrieves or expands a PostgreSQL TOAST representation into the value representation needed by an operation.
A PostgreSQL variable-length datum can be inline, compressed or represented by an external pointer. Detoasting code follows the relevant representation; slice retrieval can avoid fetching an entire uncompressed external value. The work required depends on the caller and storage form, not merely the existence of a table row. [1] [3]
Operations do not all request the same coverage. The bytea octet-length path uses toast_raw_datum_size, reading external size metadata without reconstructing the payload. A whole-value hash and a small substring ask different questions of that same field. This is an implementation-level distinction, not a recommendation to force every query to read all bytes. [2] [3]
Partial or metadata-only reads should not be counted as complete-value integrity checks. The linked experiment preserves successful-query status separately from an expected-content digest comparison and records read failures as having no digest. [4]
Relations
- related
- PostgreSQL TOAST, Checksum, Backup verification