tsvector2
tsvector2 · Compressed alternative to PostgreSQL tsvector without the original 1 MB limit, with compatible search functions and GIN, GiST, and optional RUM indexing.
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 100112 | tsvector2 | tsvector2 | 1.0 | FTS | PostgreSQL | C |
PostgreSQL · 10, 11, 12, 13
Usage
Sources:
tsvector2 is an extended full-text-search vector type designed for better compression and to remove the original tsvector 1 MB size limit. Version 1.0 mirrors common PostgreSQL text-search operations and supports B-tree, GIN, GiST, and optional RUM indexes.
Core Workflow
Store generated tsvector2 values and index them with the supplied GIN operator class:
The type supports comparison, concatenation with ||, matching with @@, ranking, weighting, filtering, lexeme deletion, and conversion from text, arrays, JSON, and JSONB.
Important Objects and Indexes
Extension-specific entry points include to_tsvector2, array_to_tsvector2, tsvector2_to_array, tsvector2_stat, jsonb_to_tsvector2, json_to_tsvector2, tsvector2_update_trigger, and tsvector2_update_trigger_column. Common names such as strip, unnest, length, setweight, ts_rank, ts_rank_cd, ts_delete, and ts_filter are overloaded for the new type.
The default classes are bt_tsvector2_ops, gin_tsvector2_ops, and gist_tsvector2_ops. If the RUM extension already exists when tsvector2 is created, installation adds RUM distance, score, and operator classes through install_rum_for_tsvector2(); install RUM first when that support is required.
The extension is fixed to the public schema and is not relocatable. Upstream describes PostgreSQL 9.6 or newer, and notes that JSON conversion behavior differs between PostgreSQL 10 and 11 in the same way as core text search. Test application queries, generated columns or triggers, and index rebuild procedures on the exact server version before replacing core tsvector storage.