[PATCH] Add contrib/anyarray: intarray-style operations and indexes for any array type

First seen: 2026-05-18 10:17:39+00:00 · Messages: 3 · Participants: 2

Latest Update

2026-06-01 · claude-opus-4-6

Monthly Summary: contrib/anyarray — Generalizing intarray to Any Array Type (May 2026)

Overview

A new contrib module anyarray was proposed to generalize contrib/intarray's set-style operations, boolean query matching, and index support to any array type with a default btree opclass (e.g., bigint[], uuid[], text[]). The patch adds 4,657 lines across 21 files and represents a substantial first submission addressing a long-standing gap in PostgreSQL's extension ecosystem.

No substantive technical review occurred this month — only a procedural note about submission formatting.

Architectural Design

The module is structured into five C source files:

Key Design Decisions

  1. Runtime type discovery: Uses lookup_type_cache() with results cached in fn_extra, correctly handling polymorphic calls with varying element types.

  2. anyquery type with lazy parsing: Unlike intarray's query_int (integer leaves), anyquery stores text tokens parsed lazily through the element type's input function at evaluation time. This allows the same query value to work against different element types.

  3. Polymorphic GiST: Fully type-agnostic signature-based index using dynamically-discovered hash functions. Configurable signature length via reloption.

  4. Per-type GIN wrappers: Due to GIN's extractQuery not receiving fn_expr, the @@ strategy requires one opclass per concrete element type (e.g., int8_anyquery_gin_ops, text_anyquery_gin_ops). This is a known limitation requiring GIN AM changes to resolve.

Known Issues and Concerns

Current Status

The thread received no substantive technical review in May. The only response was a procedural note from David Johnston pointing out that the patch was embedded in the email body rather than attached as a proper patch file. The author needs to resubmit with correct formatting before review can proceed.

History (1 prior analysis)
2026-06-01 · claude-opus-4-6

Incremental Update: Patch Resubmission with Proper Attachment

The only new message since the last analysis is from the patch author (vladmedveditskov@yandex.ru) on 2025-05-20. Based on context from the prior analysis noting David Johnston's feedback about improper patch formatting, this appears to be the author's response to resubmit the patch properly attached rather than embedded in the email body.

Assessment

No substantive technical changes or new technical discussion have occurred. This is a procedural fix addressing the submission formatting issue raised by David Johnston. The thread still lacks any substantive technical review from other community members. The patch content itself appears unchanged from the original submission.

The thread remains in the "awaiting first technical review" state.