Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: postgresql-cfbot/postgresql
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: cf/5830~1
Choose a base ref
...
head repository: postgresql-cfbot/postgresql
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: cf/5830
Choose a head ref
  • 16 commits
  • 55 files changed
  • 2 contributors

Commits on Aug 9, 2025

  1. Refactor some TOAST value ID code to use uint64 instead of Oid

    This change is a mechanical switch to change most of the code paths that
    assume TOAST value IDs to be Oids to become uint64, easing an upcoming
    change to allow 8-byte TOAST values.
    
    The areas touched are related to table AM, amcheck and logical
    decoding's reorder buffer.  A good chunk of the changes involve
    switching printf() markers from %u to PRIu64.
    michaelpq authored and Commitfest Bot committed Aug 9, 2025
    Configuration menu
    Copy the full SHA
    cba6be0 View commit details
    Browse the repository at this point in the history
  2. Minimize footprint of TOAST_MAX_CHUNK_SIZE in heap TOAST code

    This eases a follow-up change to support 8-byte TOAST value IDs, as the
    maximum chunk size allowed for a single chunk of TOASTed data depends on
    the size of the value ID.
    michaelpq authored and Commitfest Bot committed Aug 9, 2025
    Configuration menu
    Copy the full SHA
    5639c37 View commit details
    Browse the repository at this point in the history
  3. varatt_external->varatt_external_oid and VARTAG_ONDISK->VARTAG_ONDISK…

    …_OID
    
    This rename is in preparation of a follow-up commit that aims at adding
    support for multiple types of external on-disk TOAST pointers, where the
    OID type is only one subset of them.
    michaelpq authored and Commitfest Bot committed Aug 9, 2025
    Configuration menu
    Copy the full SHA
    de9ac5d View commit details
    Browse the repository at this point in the history
  4. Refactor external TOAST pointer code for better pluggability

    This commit introduces a new interface for external TOAST pointers,
    which is able to make a translation of the varlena pointers stored on
    disk to/from an new in-memory structure called toast_external.  The
    types of varatt_external supported on disk need to be registered into a
    new subsystem in a new file, called toast_external.[c|h], then define a
    set of callbacks to allow the toasting and detoasting code to use it.
    
    A follow-up change will rely on this refactoring to introduce new
    vartag_external values with an associated varatt_external_* that is
    able, which would be used in int8 TOAST tables.
    michaelpq authored and Commitfest Bot committed Aug 9, 2025
    Configuration menu
    Copy the full SHA
    0f2ff36 View commit details
    Browse the repository at this point in the history
  5. Move static inline routines of varatt_external_oid to toast_external.c

    This isolates most of the knowledge of varatt_external_oid into the
    local area where it is manipulated through the toast_external transition
    type, with the backend code not requiring it.  Extension code should not
    need it either, as toast_external should be the layer to use when
    looking at external on-dist TOAST varlenas.
    michaelpq authored and Commitfest Bot committed Aug 9, 2025
    Configuration menu
    Copy the full SHA
    c8f8b4f View commit details
    Browse the repository at this point in the history
  6. Introduce new callback to get fresh TOAST values

    This callback is called by toast_save_datum() to retrieve a new value
    from a source related to the vartag_external we are dealing with.  As of
    now, it is simply a wrapper around GetNewOidWithIndex() for the "OID"
    on-disk TOAST external pointer.
    
    This will be used later on by more external pointer types, like the int8
    one.
    
    InvalidToastId is introduced to track the concept of an "invalid" TOAST
    value, required for toast_save_datum().
    michaelpq authored and Commitfest Bot committed Aug 9, 2025
    Configuration menu
    Copy the full SHA
    eb25bbf View commit details
    Browse the repository at this point in the history
  7. Add catcache support for INT8OID

    This is required to be able to do catalog cache lookups of int8 fields
    for toast values of the same type.
    michaelpq authored and Commitfest Bot committed Aug 9, 2025
    Configuration menu
    Copy the full SHA
    56d45e0 View commit details
    Browse the repository at this point in the history
  8. Add GUC default_toast_type

    This GUC controls the data type used for newly-created TOAST values,
    with two modes supported: "oid" and "int8".  This will be used by an
    upcoming patch.
    michaelpq authored and Commitfest Bot committed Aug 9, 2025
    Configuration menu
    Copy the full SHA
    a118cdb View commit details
    Browse the repository at this point in the history
  9. Introduce global 64-bit TOAST ID counter in control file

    An 8 byte counter is added to the control file, providing a unique
    64-bit-wide source for toast value IDs, with the same guarantees as OIDs
    in terms of durability.  SQL functions and tools looking at the control
    file are updated.  A WAL record is generated every 8k values generated,
    that can be adjusted if required.
    
    Requires a bump of WAL format.
    Requires a bump of control file version.
    Requires a catalog version bump.
    michaelpq authored and Commitfest Bot committed Aug 9, 2025
    Configuration menu
    Copy the full SHA
    f575182 View commit details
    Browse the repository at this point in the history
  10. Switch pg_column_toast_chunk_id() return value from oid to bigint

    This is required for a follow-up patch that will add support for 8-byte
    TOAST values, with this function being changed so as it is able to
    support the largest TOAST value type available.
    
    XXX: Bump catalog version.
    michaelpq authored and Commitfest Bot committed Aug 9, 2025
    Configuration menu
    Copy the full SHA
    67246c3 View commit details
    Browse the repository at this point in the history
  11. Add support for bigint TOAST values

    This commit adds the possibility to define TOAST tables with bigint as
    value ID, based on the GUC default_toast_type.  All the external TOAST
    pointers still rely on varatt_external and a single vartag, with all the
    values inserted in the bigint TOAST tables fed from the existing OID
    value generator.  This will be changed in an upcoming patch that adds
    more vartag_external types and its associated structures, with the code
    being able to use a different external TOAST pointer depending on the
    attribute type of chunk_id in TOAST relations.
    
    All the changes done here are mechanical, with all the TOAST code able
    to do chunk ID lookups based on the two types supported.
    
    XXX: Catalog version bump required.
    michaelpq authored and Commitfest Bot committed Aug 9, 2025
    Configuration menu
    Copy the full SHA
    ad1c3bd View commit details
    Browse the repository at this point in the history
  12. Add tests for TOAST relations with bigint as value type

    This adds coverage for relations created with default_toast_type =
    'int8', for external TOAST pointers both compressed and uncompressed.
    michaelpq authored and Commitfest Bot committed Aug 9, 2025
    Configuration menu
    Copy the full SHA
    c778ea9 View commit details
    Browse the repository at this point in the history
  13. Add support for TOAST table types in pg_dump and pg_restore

    This includes the possibility to perform binary upgrades with TOAST
    table types applied to a new cluster, relying on SET commands based on
    default_toast_type to apply one type of TOAST table or the other.
    
    Some tests are included, this is a pretty mechanical change.
    
    Dump format is bumped to 1.17 due to the addition of the TOAST table
    type in the custom format.
    michaelpq authored and Commitfest Bot committed Aug 9, 2025
    Configuration menu
    Copy the full SHA
    99361ff View commit details
    Browse the repository at this point in the history
  14. Add new vartag_external for 8-byte TOAST values

    This is a new type of external TOAST pointer, able to be fed 8-byte
    TOAST values.  It uses a dedicated vartag_external, which is used when
    a TOAST table uses bigint for its chunk_id.
    
    The relevant callbacks are added to toast_external.c.
    michaelpq authored and Commitfest Bot committed Aug 9, 2025
    Configuration menu
    Copy the full SHA
    0214e0d View commit details
    Browse the repository at this point in the history
  15. amcheck: Add test cases for 8-byte TOAST values

    This patch is a proof of concept to show what is required to change in
    the tests of pg_amcheck to be able to work with the new type of external
    TOAST pointer.
    michaelpq authored and Commitfest Bot committed Aug 9, 2025
    Configuration menu
    Copy the full SHA
    0b15e68 View commit details
    Browse the repository at this point in the history
  16. [CF 5830] v4 - Support for 8-byte TOAST values (aka the TOAST infinit…

    …e loop problem)
    
    This branch was automatically generated by a robot using patches from an
    email thread registered at:
    
    https://commitfest.postgresql.org/patch/5830
    
    The branch will be overwritten each time a new patch version is posted to
    the thread, and also periodically to check for bitrot caused by changes
    on the master branch.
    
    Patch(es): https://www.postgresql.org/message-id/[email protected]
    Author(s): Michael Paquier
    Commitfest Bot committed Aug 9, 2025
    Configuration menu
    Copy the full SHA
    75dd50a View commit details
    Browse the repository at this point in the history
Loading