跳转到主要内容

pg_lion_citext

Case-insensitive citext operator class for lion indexes

pg_lion : Case-insensitive citext operator class for lion indexes

Overview

ID Extension Package Version Category License Language
2716 pg_lion_citext pg_lion 0.3.0 FEAT PostgreSQL SQL
Attribute Has Binary Has Library Need Load Has DDL Relocatable Trusted
----d-r No No No Yes yes no
Relationships
Requires pg_lion citext
Siblings pg_lion pg_lion_vector

Packages

Type Repo Version PG Major Compatibility Package Pattern Dependencies
EXT PIGSTY 0.3.0 19 18 17 16 15 pg_lion pg_lion, citext
RPM PIGSTY 0.3.0 19 18 17 16 15 pg_lion_$v postgresql$v-contrib
DEB PIGSTY 0.3.0 19 18 17 16 15 postgresql-$v-pg-lion -
Linux / PG PG19 PG18 PG17 PG16 PG15
el8.x86_64 N/A PIGSTY 0.3.0 PIGSTY 0.3.0 PIGSTY 0.3.0 N/A
el8.aarch64 N/A PIGSTY 0.3.0 PIGSTY 0.3.0 PIGSTY 0.3.0 N/A
el9.x86_64 MISS PIGSTY 0.3.0 PIGSTY 0.3.0 PIGSTY 0.3.0 N/A
el9.aarch64 MISS PIGSTY 0.3.0 PIGSTY 0.3.0 PIGSTY 0.3.0 N/A
el10.x86_64 MISS PIGSTY 0.3.0 PIGSTY 0.3.0 PIGSTY 0.3.0 N/A
el10.aarch64 MISS PIGSTY 0.3.0 PIGSTY 0.3.0 PIGSTY 0.3.0 N/A
d12.x86_64 MISS PIGSTY 0.3.0 PIGSTY 0.3.0 PIGSTY 0.3.0 N/A
d12.aarch64 MISS PIGSTY 0.3.0 PIGSTY 0.3.0 PIGSTY 0.3.0 N/A
d13.x86_64 MISS PIGSTY 0.3.0 PIGSTY 0.3.0 PIGSTY 0.3.0 N/A
d13.aarch64 MISS PIGSTY 0.3.0 PIGSTY 0.3.0 PIGSTY 0.3.0 N/A
u22.x86_64 MISS PIGSTY 0.3.0 PIGSTY 0.3.0 PIGSTY 0.3.0 N/A
u22.aarch64 MISS PIGSTY 0.3.0 PIGSTY 0.3.0 PIGSTY 0.3.0 N/A
u24.x86_64 MISS PIGSTY 0.3.0 PIGSTY 0.3.0 PIGSTY 0.3.0 N/A
u24.aarch64 MISS PIGSTY 0.3.0 PIGSTY 0.3.0 PIGSTY 0.3.0 N/A
u26.x86_64 MISS PIGSTY 0.3.0 PIGSTY 0.3.0 PIGSTY 0.3.0 N/A
u26.aarch64 MISS PIGSTY 0.3.0 PIGSTY 0.3.0 PIGSTY 0.3.0 N/A

Source

pig build pkg pg_lion;		# build rpm/deb

Install

Make sure PGDG and PIGSTY repo available:

pig repo add pgsql -u   # add both repo and update cache

Install this extension with pig:

pig install pg_lion;		# install via package name, for the active PG version
pig install pg_lion_citext;		# install by extension name, for the current active PG version

pig install pg_lion_citext -v 19;   # install for PG 19
pig install pg_lion_citext -v 18;   # install for PG 18
pig install pg_lion_citext -v 17;   # install for PG 17
pig install pg_lion_citext -v 16;   # install for PG 16

Create this extension with:

CREATE EXTENSION pg_lion_citext CASCADE; -- requires pg_lion, citext

Usage

Sources:

pg_lion_citext 0.3.0 registers the citext_ops operator class for case-insensitive text keys in lion indexes. It is a SQL companion shipped with pg_lion, with no separate shared library.

Core Workflow

Create citext and pg_lion first, then enable the companion. Its default operator class uses citext hashing and comparison functions for equality, inequality and ranges (=, <>, <, <=, >=, >).

CREATE EXTENSION citext;
CREATE EXTENSION pg_lion;
CREATE EXTENSION pg_lion_citext;
CREATE TABLE lion_contacts (email citext);
INSERT INTO lion_contacts VALUES ('[email protected]'), ('[email protected]');
CREATE INDEX lion_email ON lion_contacts USING lion (email);
SELECT count(*) FROM lion_contacts WHERE email = '[email protected]';

The example returns two rows in the count because both spellings compare equal. Applications keep using ordinary citext predicates.

Operational Boundaries

Requires PostgreSQL 16 or later and superuser installation. Case folding and ordering follow citext semantics. Use matching files from the parent distribution. The parent indexes retain their visibility, VACUUM, and optional custom-WAL preload requirements. This companion does not enable preloading or change existing indexes by itself.

表格阅读