Skip to content

shared_ispell

Shared-memory ispell dictionary template for reducing per-session initialization and memory.

shared_ispell · Shared-memory ispell dictionary template for reducing per-session initialization and memory.

Overview

IDExtensionPackageVersionCategoryLicenseLanguage
100069shared_ispellshared_ispell1.0.0FTSBSD-2-ClauseC

PostgreSQL · 10, 11, 12, 13, 14, 15, 16, 17, 18

Usage

Sources:

shared_ispell stores Ispell dictionaries in a fixed shared-memory segment so PostgreSQL sessions can reuse one loaded copy instead of parsing and storing a private copy per backend. It is useful for large Ispell dictionaries; Snowball dictionaries do not benefit from this extension.

Core Workflow

Choose a shared-memory budget, preload the module, and restart PostgreSQL before creating the extension.

shared_preload_libraries = 'shared_ispell'
shared_ispell.max_size = '32MB'
CREATE EXTENSION shared_ispell;

CREATE TEXT SEARCH DICTIONARY czech_shared (
  TEMPLATE = shared_ispell,
  DictFile = czech,
  AffFile = czech,
  StopWords = czech
);

SELECT ts_lexize('czech_shared', 'automobile');

Dictionary, affix, and stop-word files follow PostgreSQL text-search file placement rules. The first use loads a dictionary into the shared segment.

Management Objects

  • shared_ispell_mem_used() and shared_ispell_mem_available() report shared-memory consumption.
  • shared_ispell_dicts() and shared_ispell_stoplists() list loaded dictionaries and stop lists.
  • shared_ispell_reset() invalidates loaded data so sessions reload changed files.
  • The shared_ispell text-search template is the basis for custom dictionaries.

The shared-memory allocation cannot grow at runtime. Size it for every dictionary plus headroom; changing shared_ispell.max_size requires a restart. Upstream warns that affixes requiring full regular expressions are unsupported and fail during dictionary initialization. The project is unmaintained, so validate compatibility with the exact PostgreSQL build before production use.

Table reader