tin
lead : TIN-compatible text search for development and testing
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 2310 | tin | lead | 1.0.6 |
FTS | AGPL-3.0-or-later | Rust |
| Attribute | Has Binary | Has Library | Need Load | Has DDL | Relocatable | Trusted |
|---|---|---|---|---|---|---|
| --s-d-- | No | Yes | No | Yes | no | no |
Packages
| Type | Repo | Version | PG Major Compatibility | Package Pattern | Dependencies |
|---|---|---|---|---|---|
| EXT | PIGSTY | 1.0.6 |
18 17 16 15 14 | lead |
- |
| RPM | PIGSTY | 1.0.6 |
18 17 16 15 14 | lead_$v |
- |
| DEB | PIGSTY | 1.0.6 |
18 17 16 15 14 | postgresql-$v-lead |
- |
| Linux / PG | PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|---|
| el8.x86_64 | PIGSTY 1.0.6 | PIGSTY 1.0.6 | N/A | N/A | N/A |
| el8.aarch64 | PIGSTY 1.0.6 | PIGSTY 1.0.6 | N/A | N/A | N/A |
| el9.x86_64 | PIGSTY 1.0.6 | PIGSTY 1.0.6 | N/A | N/A | N/A |
| el9.aarch64 | PIGSTY 1.0.6 | PIGSTY 1.0.6 | N/A | N/A | N/A |
| el10.x86_64 | PIGSTY 1.0.6 | PIGSTY 1.0.6 | N/A | N/A | N/A |
| el10.aarch64 | PIGSTY 1.0.6 | PIGSTY 1.0.6 | N/A | N/A | N/A |
| d12.x86_64 | PIGSTY 1.0.6 | PIGSTY 1.0.6 | N/A | N/A | N/A |
| d12.aarch64 | PIGSTY 1.0.6 | PIGSTY 1.0.6 | N/A | N/A | N/A |
| d13.x86_64 | PIGSTY 1.0.6 | PIGSTY 1.0.6 | N/A | N/A | N/A |
| d13.aarch64 | PIGSTY 1.0.6 | PIGSTY 1.0.6 | N/A | N/A | N/A |
| u22.x86_64 | PIGSTY 1.0.6 | PIGSTY 1.0.6 | N/A | N/A | N/A |
| u22.aarch64 | PIGSTY 1.0.6 | PIGSTY 1.0.6 | N/A | N/A | N/A |
| u24.x86_64 | PIGSTY 1.0.6 | PIGSTY 1.0.6 | N/A | N/A | N/A |
| u24.aarch64 | PIGSTY 1.0.6 | PIGSTY 1.0.6 | N/A | N/A | N/A |
| u26.x86_64 | PIGSTY 1.0.6 | PIGSTY 1.0.6 | N/A | N/A | N/A |
| u26.aarch64 | PIGSTY 1.0.6 | PIGSTY 1.0.6 | N/A | N/A | N/A |
Source
github.com/planetscale/lead
lead-1.0.6.tar.gz
Install
Make sure PGDG and PIGSTY repo available:
Install this extension with pig:
Create this extension with:
Usage
Sources:
tin is the extension name of Lead, a TIN-compatible text-search implementation for development, CI, and staging. The reviewed 1.0.6 source snapshot deliberately trades performance for a small reference implementation and is unsuitable for production search.
Core Workflow
Objects and Behavior
The tin access method and ==> operator evaluate TINQL predicates. tin.score, tin.full_score, tin.max_score, and tin.score_inspect expose scoring; tin.highlight and tin.highlight_ansi mark matches. Scoring calls bind to the matching search expression and index.
Every index scan returns all heap pages as lossy candidates. PostgreSQL rechecks the visible tuples, expressions, and partial-index predicates. The index stores no search data; scoring may rescan visible heap rows. This preserves query semantics without providing a production inverted index.
Requirements
The reviewed source targets PostgreSQL 17 and 18. Installation requires a superuser; objects use the fixed tin schema. The library loads on demand and needs no preload or restart. Keep realistic data volumes in mind when using it in tests.
PlanetScale documents TIN as its production search implementation and Lead as the local development substitute. Both use the canonical extension name tin; this catalog entry tracks the open-source Lead implementation. Its source-snapshot version is not a claim about the version deployed by PlanetScale.
The current source adds a trailing stemmer argument to tin.tokenize, tin.ql_parse, tin.highlight, and tin.highlight_ansi, while keeping the earlier signatures under names ending in _v1_0_3. Changing an index’s stemmer requires REINDEX. A score call must be at the same query level as its matching ==> predicate.