postgresql/src/backend/catalog
Tomas Vondra 41d2c6f952 Add missing index_insert_cleanup calls
The optimization for inserts into BRIN indexes added by c1ec02be1d
relies on a cache that needs to be explicitly released after calling
index_insert(). The commit however failed to invoke the cleanup in
validate_index(), which calls index_insert() indirectly through
table_index_validate_scan().

After inspecting index_insert() callers, it seems unique_key_recheck()
is missing the call too.

Fixed by adding the two missing index_insert_cleanup() calls.

The commit does two additional improvements. The aminsertcleanup()
signature is modified to have the index as the first argument, to make
it more like the other AM callbacks. And the aminsertcleanup() callback
is invoked even if the ii_AmCache is NULL, so that it can decide if the
cleanup is necessary.

Author: Alvaro Herrera, Tomas Vondra
Reported-by: Alexander Lakhin
Discussion: https://postgr.es/m/202401091043.e3nrqiad6gb7@alvherre.pgsql
2024-04-19 16:08:34 +02:00
..
Catalog.pm Un-break genbki.pl's error reporting capabilities. 2024-03-20 18:02:50 -04:00
Makefile Put genbki.pl output into src/include/catalog/ directly 2024-03-14 07:11:21 +01:00
aclchk.c Reintroduce MAINTAIN privilege and pg_maintain predefined role. 2024-03-13 14:49:26 -05:00
catalog.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
dependency.c Fix type-checking of RECORD-returning functions in FROM, redux. 2024-04-15 12:56:56 -04:00
genbki.pl Generate syscache info from catalog files 2024-01-23 07:31:06 +01:00
heap.c Fix restore of not-null constraints with inheritance 2024-04-18 15:35:15 +02:00
index.c Add missing index_insert_cleanup calls 2024-04-19 16:08:34 +02:00
indexing.c Revert: Let table AM insertion methods control index insertion 2024-04-11 16:01:30 +03:00
information_schema.sql Catalog domain not-null constraints 2024-03-20 10:05:37 +01:00
meson.build Update copyright for 2024 2024-01-03 20:49:05 -05:00
namespace.c Fix search_path to a safe value during maintenance operations. 2024-03-04 17:31:38 -08:00
objectaccess.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
objectaddress.c Remove ObjectClass type 2024-03-26 10:08:56 +01:00
partition.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
pg_aggregate.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
pg_attrdef.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
pg_cast.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
pg_class.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
pg_collation.c Introduce "builtin" collation provider. 2024-03-13 23:33:44 -07:00
pg_constraint.c Better handle indirect constraint drops 2024-04-19 12:37:33 +02:00
pg_conversion.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
pg_db_role_setting.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
pg_depend.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
pg_enum.c Allow more cases to pass the unsafe-use-of-new-enum-value restriction. 2024-03-24 14:30:29 -04:00
pg_inherits.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
pg_largeobject.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
pg_namespace.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
pg_operator.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
pg_parameter_acl.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
pg_proc.c Separate equalRowTypes() from equalTupleDescs() 2024-03-17 05:58:04 +01:00
pg_publication.c Make the order of the header file includes consistent 2024-03-13 15:07:00 +01:00
pg_range.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
pg_shdepend.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
pg_subscription.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
pg_type.c Explicitly list dependent types as extension members in pg_depend. 2024-03-04 14:49:36 -05:00
sql_feature_packages.txt Update SQL features 2023-05-02 10:59:21 +02:00
sql_features.txt JSON_TABLE: Add support for NESTED paths and columns 2024-04-08 16:14:13 +09:00
storage.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
system_functions.sql Fix typos and duplicate words 2024-04-18 21:28:07 +02:00
system_views.sql Use TidStore for dead tuple TIDs storage during lazy vacuum. 2024-04-02 10:15:37 +09:00
toasting.c Add attstattarget to FormExtraData_pg_attribute 2024-03-17 12:38:27 +01:00