Skip to content

Implement AMPROP_DISTANCE_ORDERABLE in amproperty#133

Merged
tjgreen42 merged 1 commit intomainfrom
implement-amproperty
Jan 12, 2026
Merged

Implement AMPROP_DISTANCE_ORDERABLE in amproperty#133
tjgreen42 merged 1 commit intomainfrom
implement-amproperty

Conversation

@tjgreen42
Copy link
Copy Markdown
Collaborator

@tjgreen42 tjgreen42 commented Jan 12, 2026

Summary

The amproperty callback lets access methods report capabilities that Postgres can't infer automatically. For properties like distance_orderable, Postgres returns NULL if the access method doesn't implement the callback.

Since BM25 indexes support ORDER BY via the <@> operator, we should report distance_orderable = true. This improves reporting of index capabilities through tools like pgAdmin.

Fixes #103

Testing

All existing regression tests pass.

Add tp_property() function to report the distance_orderable property
for BM25 index columns. This allows pg_index_column_has_property()
to correctly return true instead of NULL for the 'distance_orderable'
property.

Fixes #103
@tjgreen42 tjgreen42 merged commit 564b18a into main Jan 12, 2026
12 checks passed
@tjgreen42 tjgreen42 deleted the implement-amproperty branch January 12, 2026 03:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement AMPROP_DISTANCE_ORDERABLE in amroutine->amproperty

1 participant