PostgreSQL 18 with pg_bigm — bigram full-text search for CJK (Japanese, Chinese, Korean) and more.
10K+
PostgreSQL 18 pre-built with pg_bigm — a bigram-based full-text search extension optimized for CJK languages (Japanese, Chinese, Korean) and any language without word delimiters.
Drop-in replacement for postgres:18. No extra setup — pg_bigm is auto-loaded and the extension
is created automatically on first start.
| Tag | Base | Size | Best for |
|---|---|---|---|
18-alpine | postgres:18-alpine | ~282 MB | CI/CD, TestContainers, lightweight |
18-bookworm / latest | postgres:18-bookworm | ~462 MB | Production, enterprise, glibc |
| compatibility |
docker run -d \
-e POSTGRES_PASSWORD=secret \
-p 5432:5432 \
dungvti/postgres-bigm:18-alpine
Then verify:
SELECT * FROM pg_extension WHERE extname = 'pg_bigm';
-- pg_bigm is ready to use
-- Create a bigram index
CREATE INDEX idx_products_name ON products USING gin (name gin_bigm_ops);
-- Search with LIKE — uses the bigram index
SELECT * FROM products WHERE name LIKE '%コーヒー%';
SELECT * FROM products WHERE name LIKE '%咖啡%';
SELECT * FROM products WHERE name LIKE '%커피%';
# Latest PG 18 + latest pg_bigm
dungvti/postgres-bigm:latest
dungvti/postgres-bigm:18-alpine
dungvti/postgres-bigm:18-bookworm
# Pinned pg_bigm version (reproducible builds)
dungvti/postgres-bigm:18-alpine-1.2-20250903
dungvti/postgres-bigm:18-bookworm-1.2-20250903
# Date-based (rollback)
dungvti/postgres-bigm:18-alpine-20260313
dungvti/postgres-bigm:18-bookworm-20260313
services:
postgres:
image: dungvti/postgres-bigm:18-alpine
environment:
POSTGRES_PASSWORD: secret
POSTGRES_DB: myapp
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5
@Container
static PostgreSQLContainer<?> postgres = new PostgreSQLContainer<>(
DockerImageName.parse("dungvti/postgres-bigm:18-alpine")
.asCompatibleSubstituteFor("postgres")
);
pg_bigm splits text into 2-character n-grams (bigrams), enabling fast LIKE '%keyword%' searches
without full tokenization. Unlike pg_trgm (trigrams), bigrams work better for short CJK
strings where trigrams produce too few matches.
| Feature | pg_bigm | pg_trgm |
|---|---|---|
| n-gram size | 2 | 3 |
| CJK support | ✅ Excellent | ⚠️ Limited |
| Short strings | ✅ | ⚠️ |
| Index type | GIN | GIN / GiST |
| Similarity search | ✅ | ✅ |
git clone https://github.com/dungndinh/postgres-bigm
cd docker
./build-and-push.sh <your-dockerhub-username> --push
Content type
Image
Digest
sha256:437436248…
Size
149.9 MB
Last updated
8 months ago
docker pull dungvti/postgres-bigm