postgres-fts

Build and test the kham-pg C extension against a local PostgreSQL instance.

Updated Apr 15, 2026
One-click install
npx skills add https://github.com/preedep/kham --skill postgres-fts
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: postgres-fts
Source: https://github.com/preedep/kham/tree/main/.claude/skills/postgres-fts
Command: npx skills add https://github.com/preedep/kham --skill postgres-fts

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Builds and tests the kham-pg C extension to integrate kham-core with PostgreSQL for Thai text search, enabling local development and verification of the extension pipeline.

Core Features & Use Cases

  • Build and test workflow for the kham-pg C extension against a local PostgreSQL instance.
  • Guidance for scaffolding kham-pg, implementing parser callbacks (startfunc/gettoken/endfunc), and integrating FtsTokenizer lexemes into a tsvector.
  • Instructions for kham_pg.control creation and SQL install scripts, plus strategies for debugging symbol export issues during extension development.

Quick Start

Run the local build and test workflow to compile the kham-pg extension against a PostgreSQL instance.

Frequently Asked Questions about postgres-fts

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build and test a PostgreSQL C extension locally?

Building and testing a PostgreSQL C extension locally requires a Rust toolchain, a C compiler, and PostgreSQL server development headers to compile a cdylib and link it with a local PostgreSQL instance for verification.

How do I implement parser callbacks for a PostgreSQL text search extension?

Implementing parser callbacks for PostgreSQL text search requires authoring startfunc, gettoken, and endfunc functions to integrate FtsTokenizer lexemes directly into a tsvector.

Do I need PostgreSQL server development headers to build a C extension with Rust?

Yes, building a PostgreSQL C extension with Rust requires PostgreSQL server development headers, a Rust toolchain with cargo, and a C compiler to successfully build and link the cdylib.

How do I create a control file and SQL install script for a PostgreSQL extension?

Creating a PostgreSQL extension involves authoring a kham_pg.control file alongside SQL install scripts to register the extension and wire FtsTokenizer lexemes into the database.

Why does my PostgreSQL extension fail to export symbols during local development?

Symbol export issues during PostgreSQL extension development typically occur when the cdylib fails to correctly link with kham-core, requiring debugging of the build configuration and compiler flags.

What is the best way to integrate Thai text search into PostgreSQL?

Integrating Thai text search into PostgreSQL is achieved by building a custom C extension that uses kham-core to parse Thai text and map FtsTokenizer lexemes into a tsvector for full-text search.