eeshwarg opened a new pull request, #2577:
URL: https://github.com/apache/age/pull/2577

   ## Summary
   
   Correct `agtype_ops_btree` to register `>=` as strategy 4 and `>` as 
strategy 5, matching PostgreSQL 
[stratnum.h](https://github.com/postgres/postgres/blob/REL_17_STABLE/src/include/access/stratnum.h).
   
   The reversed mapping causes indexed `>=` queries to omit rows equal to the 
boundary. The existing `city_id >= 8` regression even expected the incorrect 
result, omitting Mexico City; this PR corrects that expectation.
   
   ## Changes
   
   - Correct the operator-class definition for fresh installations.
   - Repair existing `pg_amop` entries in the upgrade template without dropping 
the operator class or dependent indexes. Temporary strategy numbers avoid 
catalog uniqueness conflicts; the final mapping is selected by operator 
identity so already-correct installations are also handled.
   - Update the existing `pg_opclass` row to invalidate cached ordering 
operators. Review found that updating `pg_amop` alone leaves previously used 
sessions with stale type-cache entries and can cause a subsequent sort to fail 
with "not a valid ordering operator".
   - Add regression coverage for all five B-tree comparisons, duplicate 
boundary values, explicit forward/backward index plans, and pre-existing 
indexes and cached descending sorts across extension upgrade.
   
   ## Validation
   
   - Built against stock PostgreSQL 18.4 with `COPT=-Werror`.
   - All 43 core regression tests passed on the reviewed branch.
   - Focused `scan`, `index`, and `age_upgrade` regressions passed after final 
formatting.
   - Restoring the original strategy mapping makes the boundary regression fail.
   - The before/after-upgrade sorting test reproduced the stale-cache failure 
and passes with the cache invalidation repair.
   - Optional-extension checks were not run locally.
   
   Developed and reviewed with AI assistance.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to