-
Notifications
You must be signed in to change notification settings - Fork 2
Comparing changes
Open a pull request
base repository: postgresql-cfbot/postgresql
base: cf/5830~1
head repository: postgresql-cfbot/postgresql
compare: cf/5830
- 16 commits
- 55 files changed
- 2 contributors
Commits on Aug 9, 2025
-
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.
Configuration menu - View commit details
-
Copy full SHA for cba6be0 - Browse repository at this point
Copy the full SHA cba6be0View commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for 5639c37 - Browse repository at this point
Copy the full SHA 5639c37View commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for de9ac5d - Browse repository at this point
Copy the full SHA de9ac5dView commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for 0f2ff36 - Browse repository at this point
Copy the full SHA 0f2ff36View commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for c8f8b4f - Browse repository at this point
Copy the full SHA c8f8b4fView commit details -
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().
Configuration menu - View commit details
-
Copy full SHA for eb25bbf - Browse repository at this point
Copy the full SHA eb25bbfView commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for 56d45e0 - Browse repository at this point
Copy the full SHA 56d45e0View commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for a118cdb - Browse repository at this point
Copy the full SHA a118cdbView commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for f575182 - Browse repository at this point
Copy the full SHA f575182View commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for 67246c3 - Browse repository at this point
Copy the full SHA 67246c3View commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for ad1c3bd - Browse repository at this point
Copy the full SHA ad1c3bdView commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for c778ea9 - Browse repository at this point
Copy the full SHA c778ea9View commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for 99361ff - Browse repository at this point
Copy the full SHA 99361ffView commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for 0214e0d - Browse repository at this point
Copy the full SHA 0214e0dView commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for 0b15e68 - Browse repository at this point
Copy the full SHA 0b15e68View commit details -
[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 committedAug 9, 2025 Configuration menu - View commit details
-
Copy full SHA for 75dd50a - Browse repository at this point
Copy the full SHA 75dd50aView commit details
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff cf/5830~1...cf/5830