{
  "status": "shipping",
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "updated": "2026-10-21",
  "advantages": [],
  "limitations": [],
  "slug": "postgresql-toast",
  "term": "PostgreSQL TOAST",
  "aliases": [
    "TOAST",
    "The Oversized-Attribute Storage Technique"
  ],
  "definition": "TOAST is PostgreSQL's mechanism for compressing or storing oversized attribute values outside their main table rows.",
  "note": "On-disk external values are split into chunk rows in a separate TOAST relation, while the main row retains a pointer with identifiers and size information. Not every value is external: storage strategy and value size determine the representation. [toast]\n\nEXTERNAL permits out-of-line storage without compression. For uncompressed text and bytea, substring operations can retrieve only the required portion. A readable prefix therefore need not exercise every chunk. The pinned bytea length implementation reads stored size information rather than fetching the complete value. [toast] [length] [size]\n\nHesela's PostgreSQL 16.15 experiment changed one selected bit in a synthetic external bytea. Count, length and prefix were unchanged; checksums-on full reads failed. With checksums off, the tested structural checks succeeded while comparison with the expected full-value digest failed. This is a bounded verification-coverage result, not a failure-rate estimate. [hesela-toast]",
  "related": [
    "detoasting",
    "checksum",
    "backup-verification"
  ],
  "citations": [
    {
      "id": "toast",
      "title": "PostgreSQL 16: TOAST, on-disk storage and EXTERNAL strategy",
      "url": "https://www.postgresql.org/docs/16/storage-toast.html",
      "accessed": "2026-10-21"
    },
    {
      "id": "length",
      "title": "PostgreSQL REL_16_15: varlena.c, byteaoctetlen and bytea_substring",
      "url": "https://github.com/postgres/postgres/blob/7d3e000c5961a544302072058a1184e9a588837b/src/backend/utils/adt/varlena.c",
      "accessed": "2026-10-21"
    },
    {
      "id": "size",
      "title": "PostgreSQL REL_16_15: detoast.c, toast_raw_datum_size",
      "url": "https://github.com/postgres/postgres/blob/7d3e000c5961a544302072058a1184e9a588837b/src/backend/access/common/detoast.c",
      "accessed": "2026-10-21"
    },
    {
      "id": "hesela-toast",
      "title": "Hesela: PostgreSQL TOAST read-coverage observations and code",
      "url": "https://hesela.dev/datasets/postgresql-toast-read-coverage/",
      "accessed": "2026-10-21"
    }
  ]
}
